linux 下修改卷标(磁盘名称)
测试环境
- deepin 20.3
- linux 5.10.60-amd64-desktop
- 磁盘格式 ext4
修改步骤
查看磁盘分区和卷标
lsblk
查看卷标
e2label /dev/sda3
修改卷标
e2label /dev/sda3 home
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 568.3M 1 loop /data/uengine/data/rootfs
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 105.8G 0 part /
├─sda2 8:2 0 512B 0 part
├─sda3 8:3 0 1000M 0 part /data/logs
├─sda4 8:4 0 11G 0 part [SWAP]
├─sda5 8:5 0 90G 0 part /disk/work
├─sda6 8:6 0 95.6G 0 part /disk/repo
├─sda7 8:7 0 69.2G 0 part /disk/soft
└─sda8 8:8 0 93.2G 0 part /home
sdb 8:16 0 465.8G 0 disk
└─sdb1 8:17 0 465.8G 0 part /media/john/disk-500G
$ bsudo e2label /dev/sda3
logs
$ sudo e2label /dev/sda3 logs