我无法在 bash 中安装我的 USB 驱动器。首先,我使用 parted 对其进行了格式化:
GNU Parted 3.2
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mkpart
Partition name? []? backup
File system type? [ext2]? ext4
Start? 1m
End? 100%
(parted) q
然后,我获取了分区的 UUID:
sudo blkid /dev/sdc1
/dev/sdc1: PARTLABEL="backup" PARTUUID="29e0527b-b182-46ff-b8d4-b457f2cbd19c"
接下来,我将 PARTUUID 放入 /etc/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/nvme0n1p1 during installation
UUID=96a4c1cc-8681-45a9-b3f7-634803e2c6fa / ext4 errors=remount-ro 0 1
UUID=29e0527b-b182-46ff-b8d4-b457f2cbd19c /media/backup1 ext4 noauto,defaults 0 2
到目前为止一切顺利。但是,安装不起作用:
sudo mount /media/backup1
mount: can't find UUID=29e0527b-b182-46ff-b8d4-b457f2cbd19c
因此,mount 似乎找不到此 UUID。但它在那里,我仍然可以使用 查询它sudo blkid /dev/sdc1
。此外,sudo fdisk -l
似乎也找到了它:
sudo fdisk -l
[...]
Disk /dev/sdc: 2.7 TiB, 3000592982016 bytes, 732566646 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 66AC3C98-AAF8-4E3B-90F3-2813B52F69DA
Device Start End Sectors Size Type
/dev/sdc1 256 732566527 732566272 2.7T Linux filesystem
我注意到一件有趣的事情是,该条目不在,blkid
而仅在sudo blkid
:
blkid
/dev/nvme0n1p1: UUID="96a4c1cc-8681-45a9-b3f7-634803e2c6fa" TYPE="ext4" PARTUUID="d02d7331-01"
/dev/sdb1: LABEL="datapool" UUID="7111675423553490798" UUID_SUB="13772573515660158653" TYPE="zfs_member" PARTLABEL="zfs-6e73ce37d37e2e96" PARTUUID="f46820b7-8b06-f947-bdad-c63d50404137"
/dev/sda1: LABEL="datapool" UUID="7111675423553490798" UUID_SUB="11975018375513471305" TYPE="zfs_member" PARTLABEL="zfs-ab8eb30bd084e717" PARTUUID="d29dadab-f6e7-dd4a-b7d6-442544920142
sudo blkid
/dev/nvme0n1p1: UUID="96a4c1cc-8681-45a9-b3f7-634803e2c6fa" TYPE="ext4" PARTUUID="d02d7331-01"
/dev/sdb1: LABEL="datapool" UUID="7111675423553490798" UUID_SUB="13772573515660158653" TYPE="zfs_member" PARTLABEL="zfs-6e73ce37d37e2e96" PARTUUID="f46820b7-8b06-f947-bdad-c63d50404137"
/dev/sda1: LABEL="datapool" UUID="7111675423553490798" UUID_SUB="11975018375513471305" TYPE="zfs_member" PARTLABEL="zfs-ab8eb30bd084e717" PARTUUID="d29dadab-f6e7-dd4a-b7d6-442544920142"
/dev/sda9: PARTUUID="403ede0a-5e26-4244-8a0c-5de2f00e2526"
/dev/nvme0n1: PTUUID="d02d7331" PTTYPE="dos"
/dev/sdb9: PARTUUID="91eb1b79-fc3d-6847-9b52-c2f46d04b7c6"
/dev/sdc1: PARTLABEL="backup" PARTUUID="29e0527b-b182-46ff-b8d4-b457f2cbd19c"
更新:PARTUUID=
好的,现在我设法通过使用而不是 来摆脱上述错误UUID=
。但是,现在我收到以下错误:
sudo mount /media/backup1/
mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
的输出dmesg | tail
如下:
[ 3349.566573] EXT4-fs (sdc1): VFS: Can't find ext4 filesystem
现在有什么问题?
答案1
自从您对驱动器进行分区并创建文件系统以来,您是否断开/重新连接了 USB 驱动器或重新启动了机器?如果没有,请运行
sudo partprobe /dev/sdc
告诉内核更新有关驱动器上的分区表和文件系统 UUID 的信息。