如果没有 Homebrew 的话,需要先安装 Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装 e2fsprogs
brew install e2fsprogs
把 U 盘插到 Mac 上,执行:
diskutil list
找到自己 U 盘的盘符,比如我这里是:/dev/disk2s1,
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *31.0 GB disk2
1: DOS_FAT_32 KINGSTON 31.0 GB disk2s1
然后执行格式化:
diskutil unmountdisk /dev/disk2s1
sudo $(brew --prefix e2fsprogs)/sbin/mkfs.ext4 /dev/disk2s1
执行命令后会要求输入用户密码,然后输入 y 确认,等待一会儿就可以了。
2 条评论
您好,我是小白,和您请教一下哦。如果您有空QQ回复的话,非常感谢!
我在第一步输入完安装homebrew的命令后,终端报错
wangneddeMBP:~ ned$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
curl: (28) Operation timed out after 300128 milliseconds with 0 out of 0 bytes received
不知道怎么回事,而且安装第二步,e2fsprogs,也报错。
装homebrew的时候,报错还会显示这样,
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
wangneddeMBP:~ ned$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443
非常抱歉,我是刚刚看到你的评论,这个提示和国内的网络环境有关,你可以试一下下面的这个国内安装地址:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"