linux dd命令刻录启动U盘详解

时间:2023-01-04 17:00:38

dd if=xxx.iso of=/dev/sdb bs=1M

用以上命令前必须卸载u盘,sdb是你的u盘,bs=1M是块的大小,后面的数值大,写的速度相对块一点,但也不是无限的,我一般选2M,注意,执行命令后很块完成,但u盘还在闪,等不闪了,安全移除。

[root@ok Desktop]# fdisk -l

Disk /dev/sda: 500.1 GB,  bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x000dcf9e Device Boot Start End Blocks Id System
/dev/sda1 * Linux
Partition does not end on cylinder boundary.
/dev/sda2 8e Linux LVM Disk /dev/mapper/vg_ok-lv_root: 53.7 GB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00000000 Disk /dev/mapper/vg_ok-lv_swap: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00000000 Disk /dev/sdd: 15.5 GB, bytes #这是U盘
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x39768880 Device Boot Start End Blocks Id System
/dev/sdd1 * Hidden HPFS/NTFS Disk /dev/mapper/vg_ok-lv_home: 442.1 GB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Sector size (logical/physical): bytes / bytes
I/O size (minimum/optimal): bytes / bytes
Disk identifier: 0x00000000
[root@ok Desktop]# /bin/dd if=/home/ISO/CentOS--x86_64-Minimal-.iso of=/dev/sdb

上面的这命令注意是/dev/sdb 不是/dev/sdb1