1、添加一块硬盘(20G),分1个主分区,3个逻辑分区。
进行分区的命令:
划分主分区:
划分扩展分区:
划分逻辑分区:
2、将主分区格式化为ext4,并挂载到/mnt/sdb1目录下。
[root@localhost ~]# mkfs -t ext4 /dev/sdc1
[root@localhost ~]# mkdir /mnt/sdb1
[root@localhost ~]# cd /mnt/
[root@localhost mnt]# mount -t ext4 /dev/sdc1 /mnt/sdb1
[root@localhost mnt]# df -h /dev/sdc1 查看是否挂载成功
文件系统 容量 已用 可用 已用% 挂载点
/dev/sdc1 5.8G 24M 5.5G 1% /mnt/sdb1
3、将sdb5格式化为ext3,并挂载到/mnt/sdb3目录下为只读。
[root@localhost mnt]# mkfs -t ext3 /dev/sdc5
[root@localhost ~]# mkdir /mnt/sdb3
[root@localhost mnt]# mount -r /dev/sdc5 /mnt/sdb3
[root@localhost mnt]# df -h /mnt/sdb3 查看是否挂载
文件系统 容量 已用 可用 已用% 挂载点
/dev/sdc5 4.8G 11M 4.6G 1% /mnt/sdb3
[root@localhost mnt]# mount | grep sdc5
/dev/sdc5 on /mnt/sdb3 type ext3 (ro ,relatime,seclabel,data=ordered)