mac制作centos7 u盘安装盘

1. 下载cento7的镜像

centos官网 去找想要的版本下载就行了。

比如这个阿里云的镜像可能会快些:http://mirrors.aliyun.com/centos/7.7.1908/isos/x86_64/CentOS-7-x86_64-DVD-1908.iso

2. 插上U盘

插上U盘,先查看一下电脑上有哪些盘

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 314.6 MB disk0s1
2: Apple_APFS Container disk1 250.7 GB disk0s2

/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +250.7 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD - 数据 141.3 GB disk1s1
2: APFS Volume Preboot 82.4 MB disk1s2
3: APFS Volume Recovery 528.1 MB disk1s3
4: APFS Volume VM 4.3 GB disk1s4
5: APFS Volume Macintosh HD 11.1 GB disk1s5

/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *15.7 GB disk2
1: Windows_NTFS ESD-USB 15.7 GB disk2s1

/dev/disk2 就是我的U盘

2. 卸载U盘

卸载/dev/disk2:

1
2
$ diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful

3. 使用dd 工具把镜像文件写到U盘里

1
2
3
4
5
$ sudo dd if=/Users/huazhizui/Downloads/CentOS-7-x86_64-DVD-1908.iso of=/dev/disk2 bs=1m
Password:
4448+0 records in
4448+0 records out
4664066048 bytes transferred in 4102.428971 secs (1136904 bytes/sec)

整个过程可能需要几十分钟, 耐心等待。