背景:买了一块新的ssd硬盘,挂载到ubuntu下。

1、快速格式化:

1)查看ssd硬盘的盘符: sudo fdisk -l

2)快速格式化: sudo mkfs.ext4 -T default /dev/sdc

关于mkfs命令的T参数, man mkfs.ext4 有一段解释:

-T usage-type[,...]
Specify how the filesystem is going to be used, so that mke2fs can choose optimal filesystem parameters for that use. The
usage types that are supported are defined in the configuration file /etc/mke2fs.conf. The user may specify one or more
usage types using a comma separated list. If this option is is not specified, mke2fs will pick a single default usage type based on the size of the filesystem to be
created. If the filesystem size is less than megabytes, mke2fs will use the filesystem type floppy. If the filesystem
size is greater than or equal to but less than megabytes, mke2fs() will use the filesystem type small. If the
filesystem size is greater than or equal to terabytes but less than terabytes, mke2fs() will use the filesystem type
big. If the filesystem size is greater than or equal to terabytes, mke2fs() will use the filesystem type huge. Other‐
wise, mke2fs() will use the default filesystem type default.

2、挂载:

mkdir -p /mnt/abc
mount -t auto /dev/sdc /mnt/abc

3、

1)卸载: umount /mnt/abc

2)如果碰到无法卸载,提示:device is busy等等,可以用fuser命令: fuser -km /mnt/abc

04-14 09:32
查看更多