Linux系统制作 Ubuntu Server 24.04 启动U盘详细教程

⚠️ 极高风险提醒dd命令直接裸写块设备,务必确认 U 盘设备名 ,一旦写错会直接物理销毁服务器硬盘全部数据!!! U 盘容量最低要求 8GB,U 盘内全部数据会被清空。

镜像文件名:ubuntu-24.04.4-live-server-amd64.iso(Server 版本,不要下载 desktop 桌面版)

1.下载官方镜像 + 校验完整性

bash 复制代码
# 下载镜像
wget https://releases.ubuntu.com/24.04/ubuntu-24.04.4-live-server-amd64.iso
# 下载校验文件
wget https://releases.ubuntu.com/24.04/SHA256SUMS
# 校验,输出OK代表镜像完整
[root@node2 ~]# sha256sum -c SHA256SUMS --ignore-missing
sha256sum: unrecognized option '--ignore-missing'
Try 'sha256sum --help' for more information.
[root@node2 ~]# sha256sum -c SHA256SUMS
sha256sum: ubuntu-24.04.3-desktop-amd64.iso: No such file or directory
ubuntu-24.04.3-desktop-amd64.iso: FAILED open or read
sha256sum: ubuntu-24.04.3-live-server-amd64.iso: No such file or directory
ubuntu-24.04.3-live-server-amd64.iso: FAILED open or read
sha256sum: ubuntu-24.04.3-wsl-amd64.wsl: No such file or directory
ubuntu-24.04.3-wsl-amd64.wsl: FAILED open or read
sha256sum: ubuntu-24.04.4-desktop-amd64.iso: No such file or directory
ubuntu-24.04.4-desktop-amd64.iso: FAILED open or read
ubuntu-24.04.4-live-server-amd64.iso: OK
sha256sum: ubuntu-24.04.4-wsl-amd64.wsl: No such file or directory
ubuntu-24.04.4-wsl-amd64.wsl: FAILED open or read
sha256sum: WARNING: 5 listed files could not be read

输出ubuntu‑24.04.4‑live‑server‑amd64.iso: OK才可以继续,FAILED 必须重新下载镜像。

2.卸载 U 盘所有挂载分区

如果 U 盘自动挂载,必须全部卸载,否则 dd 报错资源忙,写出来的 U 盘无法启动。

bash 复制代码
umount /dev/sdb

sdb替换为你自己识别到的 U 盘设备名。提示not mounted说明已经卸载完毕,无需处理。

3.dd 写入镜像到 U 盘

写入前切勿忘记备份U盘内容,写入时会格式化清理U盘数据!手动格式化U盘请参阅:Linux系统格式化U盘教程-CSDN博客

bash 复制代码
[root@node2 ~]# dd if=./ubuntu-24.04.4-live-server-amd64.iso of=/dev/sdb bs=4M status=progress conv=fsync
2466250752 bytes (2.5 GB) copied, 1.000113 s, 2.5 GB/s

811+1 records in
811+1 records out
3405469696 bytes (3.4 GB) copied, 570.765 s, 6.0 MB/s

参数解释:

  • if= 输入:本地 iso 镜像路径
  • of= 输出:完整 U 盘设备,不带分区数字
  • bs=4M:块大小,加快写入速度
  • status=progress:实时显示写入进度
  • conv=fsync:全部数据写完后强制刷写到 U 盘硬件,防止缓存未落盘直接拔盘损坏介质

命令行提示符返回,代表写入完成。

4.安全拔出 U 盘

不要写完立刻直接拔 U 盘! sync 确保操作系统缓存全部写入 U 盘硬件。

bash 复制代码
sync
# 确认无IO之后再拔U盘
sudo eject /dev/sdb
相关推荐
hehelm1 小时前
仿muduo库实现高并发服务器—EventLoop
linux·服务器·网络·c++
Lucky09281 小时前
codex 安装前置软件
linux·运维·macos
mengge.cloud1 小时前
0823Keepalived + LVS(DR) + MariaDB主主 小白完整实战教程
linux·运维·网络·oracle·负载均衡·mariadb·lvs
kk”9 小时前
Linux的组和权限管理
linux·运维·服务器
智购科技智能售货柜10 小时前
2026自动售货机整机可靠性测试:从高低温交变到EMC电磁兼容的认证工程实践~YH
运维·服务器·数据库·人工智能·物联网
mohesashou10 小时前
红帽linux的K8S部署
linux·kubernetes·ansible
xiaoye-duck11 小时前
《Linux网络编程》UDP Socket 编程实战:从 Echo 回显、通用字典服务到套接字封装全流程
linux·网络·udp
酒神dnspup11 小时前
CDN 回源检测怎么做?用 DNSPup 验证节点命中、源站暴露与多地可用性
运维·服务器·网络·网络协议·tcp/ip