新加一块硬盘做备份分区使用
添加硬盘,开机进入系统
执行fdisk -l
命令查看新加的硬盘是否正常添加,记住盘号例如/dev/sdb
执行fdisk
命令进行分区:fdisk /dev/sdb
执行mkfs
命令格式化分区:mkfs.ext4 -c /dev/sdb1
mkfs.xfs -f /dev/vdd1
新建挂载目录:mkdir /data
执行mount
命令挂载:mount /dev/sdb1 /data
修改/etc/fstab
文件,使其开机自动挂载
UUID=09761a1c-c938-44e7-8e7d-dda5489971cf /data ext4 defaults 1 2
# blkid
报错:
# mkfs -t ext4 -c /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
/dev/sdb1 is apparently in use by the system; will not make a filesystem here!
处理:
# dmsetup status
ddf1_4c5349202020202080862682000000004711471100001e78: 0 1462890496 linear
ddf1_4c5349202020202080862682000000004711471100001e78p1: 0 1462878837 linear
# dmsetup remove_all
# mkfs -t ext4 -c /dev/sdb1