parted 大容量硬盘分区 格式化

#分区
parted /dev/sdb
mklabel gpt
mkpart primary 0 -1
#格式化
mkfs.xfs -f /dev/sdb1

 

针对 sda sdb 变动问题

UUID (globally unique identifier),
唯一的身份识别,是采用SCSI Inquiry命令的Page 83信息来映射磁盘设备的。
例如我们可以在Linux下查询一些磁盘设备的UUID标识代码。 引用 bash# ls
-la /dev/disk/by-id total 0 drwxr-xr-x 2 root root 280 Mar 11 12:29 . drwxr-xr-x 5 root root 100 Mar 11 12:28 .. lrwxrwxrwx 1 root root 9 Mar 11 12:29 edd-int13_dev80 -> ../../sda lrwxrwxrwx 1 root root 10 Mar 11 12:29 edd-int13_dev80-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 Mar 11 12:29 edd-int13_dev80-part3 -> ../../sda3 lrwxrwxrwx 1 root root 10 Mar 11 12:29 edd-int13_dev80-part4 -> ../../sda4 lrwxrwxrwx 1 root root 10 Mar 11 12:29 edd-int13_dev80-part5 -> ../../sda5 lrwxrwxrwx 1 root root 10 Mar 11 12:29 edd-int13_dev80-part6 -> ../../sda6 lrwxrwxrwx 1 root root 9 Mar 11 12:28 scsi-3600050e03d7c67007bf400009f890000 - > ../../sda lrwxrwxrwx 1 root root 10 Mar 11 12:28 scsi-3600050e03d7c67007bf400009f890000-p art1 -> ../../sda1 lrwxrwxrwx 1 root root 10 Mar 11 12:28 scsi-3600050e03d7c67007bf400009f890000-p art3 -> ../../sda3 lrwxrwxrwx 1 root root 10 Mar 11 12:28 scsi-3600050e03d7c67007bf400009f890000-p art4 -> ../../sda4 lrwxrwxrwx 1 root root 10 Mar 11 12:28 scsi-3600050e03d7c67007bf400009f890000-p art5 -> ../../sda5 lrwxrwxrwx 1 root root 10 Mar 11 12:28 scsi-3600050e03d7c67007bf400009f890000-p art6 -> ../../sda6 找到了磁盘设备唯一的UUID代码后,就可以加到/etc/grub.conf和/etc/fstab中,
这样即使初始的系统盘sda变成了sdb,
但Linux和文件系统的启动加载都是按照UUID来的,所以上层也不会受到影响

 

posted @ 2020-12-10 16:28  嘿.嘿.嘿  阅读(471)  评论(0编辑  收藏  举报