每次重启后分区名称都会改变

每次重启后分区名称都会改变

每次我重启时,我的 C:(用于双启动 Windows 和 Ubuntu 的主 SSD)驱动器上的分区几乎都会获得不同的名称。我想使分区名称永久化,以便我可以安全地链接到文件。

我的分区名称如下:

/media/andrew/AC7A30A47A306D68/Program Files (x86)...

以下是我的 fstab 文件的内容:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda8 during installation
UUID=5fcb9158-c68b-47c7-8fe7-e83ceba9cb99 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=CA2F-944D  /boot/efi       vfat    defaults        0       1

请帮忙。我在网上找遍了,但只找到了这些帖子,我不太明白它们的说明。就像这里 > 挂载点名称已更改 或点击此处 > 为什么磁盘名称在启动时改变

答案1

使用此命令确定C:驱动器的 UUID:

sudo blkid

示例输出:

/dev/sda1: UUID="f1b3915e-3c86-a3ec-3273-43967f134ce5" UUID_SUB="f48bf957-6f67-171f-ea75-29ddbd401637" LABEL="ubuntu:0" TYPE="linux_raid_member" 
/dev/sda2: LABEL="Win" UUID="28A139962EFFC093" TYPE="ntfs" 
/dev/sda3: UUID="571a61fe-6e6f-45d0-9fe1-832f28519f96" TYPE="reiserfs" 
/dev/sdb1: UUID="f1b3915e-3c86-a3ec-3273-43967f134ce5" UUID_SUB="d0318ec5-9e4c-a864-7906-2d43bcbd0374" LABEL="ubuntu:0" TYPE="linux_raid_member" 
/dev/md0p1: UUID="88dc483f-aef9-454b-b744-2c3e3202a198" TYPE="swap" 
/dev/md0p5: LABEL="Home" UUID="b632fe56-564e-4d3f-833a-fde68fd1dd32" TYPE="ext4" 
/dev/md0p6: LABEL="Ubuntu" UUID="da84c996-f7d0-4fe8-8822-407e4f6c5c22" TYPE="ext4"

找到与您的驱动器相对应的设备C:(如果困难的话请使用标签)并将此行添加到您的/etc/fstab

 UUID=AC7A30A47A306D68 /windows        ntfs    defaults,umask=007,gid=46 0       0

重新启动(或执行sudo mount -a)并查看安装在中的驱动器/windows

相关内容