Ubuntu 设定硬盘分区的卷标 (名字)

(115) 2024-05-10 18:01:01



Ubuntu 设定 (命名) 硬盘分区的卷标 (名字)

Ubuntu 硬盘插入电脑,需要把硬盘挂载到文件夹上,才能访问硬盘的文件。挂载到服务器上的 media 文件夹,重命名为直观的名字。

1. Ubuntu 硬盘自动挂载

Ubuntu 设定硬盘分区的卷标 (名字) (https://mushiming.com/)  第1张

(base) yongqiang@famu-sys:/media/yongqiang$ conda deactivate
yongqiang@famu-sys:/media/yongqiang$ ll
总用量 24
drwxrwxrwx+ 6 root      root      4096 3月   5 20:28 ./
drwxrwxrwx  6 root      root      4096 3月  10  2019 ../
drwxrwxrwx  1 yongqiang yongqiang 4096 3月   5 15:16 1D9AB30347206195/
drwxrwxrwx  1 yongqiang yongqiang 4096 3月   5 13:21 34D026064C8113E6/
drwxrwxrwx  1 yongqiang yongqiang 4096 3月   5 12:36 60BF21875D995539/
drwxrwxrwx  1 yongqiang yongqiang 4096 3月   5 13:27 7B4FF63D56B43F6A/
yongqiang@famu-sys:/media/yongqiang$ 

2. sudo blkid

yongqiang@famu-sys:/media/yongqiang$ sudo blkid
[sudo] yongqiang 的密码: 
/dev/sda: LABEL="DISK_DEEP" UUID="5fd969d1-7ade-4e69-884c-dfff29f539f7" TYPE="ext4"
/dev/sdb: LABEL="DISK_NORTH" UUID="70fb4fa8-36a4-422c-8ae6-d5e1cbee95a8" TYPE="ext4"
/dev/sdc: LABEL="DISK_DATA" UUID="313f7b25-94f4-46ad-aac5-a8ff7da73918" TYPE="ext4"
/dev/sdd1: UUID="53a5a063-1ea4-434d-ad98-6cdaefff158a" TYPE="ext4" PARTUUID="1ef77e49-01"
/dev/sdd5: UUID="ed619771-4748-4f5a-86a5-355c8c22a290" TYPE="swap" PARTUUID="1ef77e49-05"
/dev/sde1: UUID="7B4FF63D56B43F6A" TYPE="ntfs" PARTLABEL="primary" PARTUUID="8ec4d186-c8ab-42d8-81d5-d3c4ad2ab4f8"
/dev/sde2: UUID="1D9AB30347206195" TYPE="ntfs" PARTLABEL="extended" PARTUUID="c61c8c3a-509d-41d3-91e6-bd0ae2899b14"
/dev/sde3: UUID="60BF21875D995539" TYPE="ntfs" PARTLABEL="extended" PARTUUID="ff5adc28-ceca-4f76-9776-511b00e82518"
/dev/sde4: UUID="34D026064C8113E6" TYPE="ntfs" PARTLABEL="extended" PARTUUID="0a21983a-5913-46a0-9d16-60e4f785d130"
yongqiang@famu-sys:/media/yongqiang$
  • 每一行表示一个分区
  • /dev/sda 是第一个硬盘
  • /dev/sdb 是第二个硬盘
  • /dev/sdc 是第三个硬盘
  • /dev/sdd 是第四个硬盘
  • /dev/sde 是第五个硬盘
  • LABEL="DISK_DEEP" - LABEL="DISK_NORTH" - LABEL="DISK_DATA" 是硬盘分区的名字 (卷标)
  • UUID="******" 是通用唯一识别码 (Universally Unique Identifier,UUID) 是硬盘分区唯一编号
  • TYPE="ntfs" 是硬盘分区的格式

2.1 sudo e2label /dev/sde1 Backup_A 修改卷标名失败

yongqiang@famu-sys:/media/yongqiang$ sudo e2label /dev/sde1 Backup_A
e2label: Bad magic number in super-block 当尝试打开 /dev/sde1 时
找不到有效的文件系统超级块.
yongqiang@famu-sys:/media/yongqiang$ 
yongqiang@famu-sys:/media/yongqiang$ sudo blkid
/dev/sda: LABEL="DISK_DEEP" UUID="5fd969d1-7ade-4e69-884c-dfff29f539f7" TYPE="ext4"
/dev/sdb: LABEL="DISK_NORTH" UUID="70fb4fa8-36a4-422c-8ae6-d5e1cbee95a8" TYPE="ext4"
/dev/sdc: LABEL="DISK_DATA" UUID="313f7b25-94f4-46ad-aac5-a8ff7da73918" TYPE="ext4"
/dev/sdd1: UUID="53a5a063-1ea4-434d-ad98-6cdaefff158a" TYPE="ext4" PARTUUID="1ef77e49-01"
/dev/sdd5: UUID="ed619771-4748-4f5a-86a5-355c8c22a290" TYPE="swap" PARTUUID="1ef77e49-05"
/dev/sde1: UUID="7B4FF63D56B43F6A" TYPE="ntfs" PARTLABEL="primary" PARTUUID="8ec4d186-c8ab-42d8-81d5-d3c4ad2ab4f8"
/dev/sde2: UUID="1D9AB30347206195" TYPE="ntfs" PARTLABEL="extended" PARTUUID="c61c8c3a-509d-41d3-91e6-bd0ae2899b14"
/dev/sde3: UUID="60BF21875D995539" TYPE="ntfs" PARTLABEL="extended" PARTUUID="ff5adc28-ceca-4f76-9776-511b00e82518"
/dev/sde4: UUID="34D026064C8113E6" TYPE="ntfs" PARTLABEL="extended" PARTUUID="0a21983a-5913-46a0-9d16-60e4f785d130"
yongqiang@famu-sys:/media/yongqiang$ 
yongqiang@famu-sys:/media/yongqiang$ sudo e2label /dev/sde1 Backup_A
e2label: Bad magic number in super-block 当尝试打开 /dev/sde1 时
找不到有效的文件系统超级块.
yongqiang@famu-sys:/media/yongqiang$ 
yongqiang@famu-sys:/media/yongqiang$ sudo e2label /dev/sde2 Backup_B
e2label: Bad magic number in super-block 当尝试打开 /dev/sde2 时
找不到有效的文件系统超级块.
yongqiang@famu-sys:/media/yongqiang$ 

Ubuntu 设定硬盘分区的卷标 (名字) (https://mushiming.com/)  第2张

yongqiang@famu-sys:/media/yongqiang$ sudo blkid
/dev/sda: LABEL="DISK_DEEP" UUID="5fd969d1-7ade-4e69-884c-dfff29f539f7" TYPE="ext4"
/dev/sdb: LABEL="DISK_NORTH" UUID="70fb4fa8-36a4-422c-8ae6-d5e1cbee95a8" TYPE="ext4"
/dev/sdc: LABEL="DISK_DATA" UUID="313f7b25-94f4-46ad-aac5-a8ff7da73918" TYPE="ext4"
/dev/sdd1: UUID="53a5a063-1ea4-434d-ad98-6cdaefff158a" TYPE="ext4" PARTUUID="1ef77e49-01"
/dev/sdd5: UUID="ed619771-4748-4f5a-86a5-355c8c22a290" TYPE="swap" PARTUUID="1ef77e49-05"
yongqiang@famu-sys:/media/yongqiang$ 

3. 修改卷标名成功

Ubuntu 设定硬盘分区的卷标 (名字) (https://mushiming.com/)  第3张
点击黑色正方形 -> 卸载卷 -> 变成黑色三角形
Ubuntu 设定硬盘分区的卷标 (名字) (https://mushiming.com/)  第4张
Edit Filesystem - 编辑文件系统
Ubuntu 设定硬盘分区的卷标 (名字) (https://mushiming.com/)  第5张
Label: Backup_A
Ubuntu 设定硬盘分区的卷标 (名字) (https://mushiming.com/)  第6张
Ubuntu 设定硬盘分区的卷标 (名字) (https://mushiming.com/)  第7张
Label: Backup_D
Ubuntu 设定硬盘分区的卷标 (名字) (https://mushiming.com/)  第8张
点击黑色三角形 -> 挂载卷 -> 变成黑色正方形
Ubuntu 设定硬盘分区的卷标 (名字) (https://mushiming.com/)  第9张

References

https://wiki.ubuntu.org.cn/%E9%87%8D%E5%91%BD%E5%90%8DUSB%E7%A3%81%E7%9B%98%E6%8C%82%E8%BD%BD%E5%88%86%E5%8C%BA%E5%8D%B7%E6%A0%87

THE END

发表回复