如果已卸载和未格式化,如何格式化磁盘并进行装载?


0

我正在运行Ubuntu,并希望我的启动脚本检查是否已安装特定光盘并对其格式化(如果尚未格式化ext4)。我不希望磁盘格式化,因为它已经在上一次启动时进行了格式化。

Answers:


0

首先,通过查看来检查磁盘的存在/dev/disk/by-id,然后blkid在其上运行,解析“ ext4”的输出,然后尝试装入它。在故障blkidmount会导致mkfs.ext4和重试。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.