我在从克隆映像恢复系统时遇到了一些麻烦,但最终成功了。但是启动并启动 GParted(或 blkid 等)时,我发现设备命名与以前相比略有变化:系统 HD 已变为 /sdb,而 /sda 现在与第二个 HD 关联。没问题,因为 fstab 正在使用 UUID。然而,启动实时 GParted 后,我发现面额颠倒了:这里的可启动 HD 是 /sda。
我以前从未遇到过这样的不匹配,并且想知道它是如何发生的并可能纠正它以避免备份时出现混乱。感谢帮助。
- - 更新 - -
今天,我重复了下面的命令,发现硬盘被交换了:/sdb = DEP,/sdc = DAT。
相反,从外部实时应用程序,它们的结果被交换回来。
所以现在我的问题变成:a)内部硬盘(USB 除外)在重新启动后被赋予不同的名称,而 fstab 文件不变,这是否“正常”? b) 从不同的实时操作系统启动时,上述情况是否正常?
a) fdisk -l
:~$ sudo fdisk -l
Disk /dev/sdb: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC WD5000LPCX-2
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xa1721481
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 976773119 976771072 465.8G 7 HPFS/NTFS/exFAT
Disk /dev/sda: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: CT250MX500SSD1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 8BD4973B-8ED8-4E4E-9697-F99AAC5C29D1
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 157931519 156880896 74.8G Linux filesystem
/dev/sda3 471719936 488396799 16676864 8G Linux swap
/dev/sda4 157931520 314812415 156880896 74.8G Linux filesystem
/dev/sda5 314812416 471693311 156880896 74.8G Linux filesystem
Partition table entries are not in disk order.
Disk /dev/sdc: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC WD5000LPCX-2
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xa0531363
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 976773119 976771072 465.8G 7 HPFS/NTFS/exFAT
Disk /dev/sdd: 465.73 GiB, 500074283008 bytes, 976707584 sectors
Disk model: Elements 10B8
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf55dd744
Device Boot Start End Sectors Size Id Type
/dev/sdd1 2048 976707583 976705536 465.7G 7 HPFS/NTFS/exFAT
b)安装
mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=4014420k,nr_inodes=1003605,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=816100k,mode=755)
/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=22869)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
/dev/sdc1 on /media/DEP type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sdb1 on /media/DAT type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=816096k,nr_inodes=204024,mode=700,uid=1000,gid=1000)
c) df
~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 4014420 0 4014420 0% /dev
tmpfs 816100 1452 814648 1% /run
/dev/sda5 76630796 37659824 35032568 52% /
tmpfs 4080488 0 4080488 0% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
/dev/sda1 523244 3484 519760 1% /boot/efi
/dev/sdc1 488385532 356804224 131581308 74% /media/DEP
/dev/sdb1 488385532 85393624 402991908 18% /media/DAT
tmpfs 816096 104 815992 1% /run/user/1000
d) 黑体
~$ sudo blkid
/dev/sdb1: LABEL="DAT" BLOCK_SIZE="512" UUID="607D3FC24755E8F0" TYPE="ntfs" PARTUUID="a1721481-01"
/dev/sda1: UUID="4CC3-896F" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="ec058c4e-6a6f-4092-900d-7cd848fbdb33"
/dev/sda2: UUID="257dc913-2dbb-4fa9-92b7-c44d38c26824" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="A2" PARTUUID="7790face-c85c-4c73-921c-c1af2c4f5ad4"
/dev/sda3: UUID="cc1c51cb-696e-4dd6-9e11-8c419914897a" TYPE="swap" PARTUUID="5c968f4e-4102-4a80-b41d-ced206c5305b"
/dev/sda4: LABEL="a64-tst" UUID="e1c67118-0497-4652-8a08-addf8ee6dce0" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="A4" PARTUUID="c5275a00-4586-4a83-98ec-6ad2fe0d1488"
/dev/sda5: LABEL="a64be" UUID="2f875747-4d12-4bc7-bd16-15fc18f4e828" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="A5" PARTUUID="19a2c00d-0441-42c3-b550-bdc3fe91b3f9"
/dev/sdc1: LABEL="DEP" BLOCK_SIZE="512" UUID="076038063EB7EFAE" TYPE="ntfs" PARTUUID="a0531363-01"
/dev/sdd1: LABEL="Elements" BLOCK_SIZE="512" UUID="B4D48115D480DB4E" TYPE="ntfs" PARTUUID="f55dd744-01"
/dev/sr1: BLOCK_SIZE="2048" UUID="2022-07-05-11-24-53-00" LABEL="HonorSuiteM-bM-^@M-^@M-bM-^@M-^@M-bM-^@M-^@M-bM-^@M-^@M-bM-^@M-^@M-bM-^@M-^@" TYPE="iso9660" PTTYPE="mac"