AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[fstab](ubuntu)

Martin Hope
Victor
Asked: 2024-11-09 23:35:49 +0800 CST

升级至 24.10 后无法交换

  • 8

我全新安装了 Ubuntu 24.04,其中有 ZFS 和由 Ubuntu 安装程序自动创建的 8GB 交换分区,如下所示/dev/nvme0n1p3。

我升级到 24.10,重启后交换分区不可用。似乎swapon找不到加密分区。升级过程中出了什么问题?

/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>
/dev/disk/by-id/dm-uuid-CRYPT-PLAIN-dm_crypt-0 none swap sw 0 0
# Use `zfs list` for current zfs mount info
# bpool none defaults 0 0
# Use `zfs list` for current zfs mount info
# rpool none defaults 0 0
# Use `zfs list` for current zfs mount info
# rpool / defaults 0 0
# Use `zfs list` for current zfs mount info
# rpool none defaults 0 0
# Use `zfs list` for current zfs mount info
# rpool /root defaults 0 0
# Use `zfs list` for current zfs mount info
# rpool /home defaults 0 0
# Use `zfs list` for current zfs mount info
# bpool /boot defaults 0 0
# /boot/efi was on /dev/nvme0n1p1 during curtin installation
/dev/disk/by-uuid/6DA7-371B /boot/efi vfat defaults 0 1

还有我的/etc/crypttab:

dm_crypt-0 PARTUUID=d5018485-33be-40b8-80a1-9adb3c96ff16 /dev/urandom swap,initramfs

我尝试用/etc/crypttab替换 ID ,但重启后问题仍未解决。PARTUUID=d5018485-33be-40b8-80a1-9adb3c96ff16/dev/nvme0n1p3

我还尝试添加以下选项: swap,initramfs,plain,cipher=aes-xts-plain64,size=256

$ sudo blkid:(我没有显示许多循环设备)

/dev/nvme0n1p1: UUID="6DA7-371B" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="604b52dd-b0fc-43d8-8661-3dcb64869220"
/dev/nvme0n1p4: LABEL="rpool" UUID="15673004915406136913" UUID_SUB="7631777870671497537" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="2157f054-6832-42fb-8032-8d2fb89b235b"
/dev/nvme0n1p2: LABEL="bpool" UUID="8036775395222734905" UUID_SUB="16758030276404416519" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="ec3c6766-9115-4fa6-b9d4-793d092a7bb4"
/dev/mapper/keystore-rpool: LABEL="keystore-rpool" UUID="bda5d08f-4300-4ecf-9dd1-9c6958d53738" BLOCK_SIZE="4096" TYPE="ext4"
/dev/nvme0n1p3: PARTUUID="d5018485-33be-40b8-80a1-9adb3c96ff16"
/dev/zd0: UUID="2586988a-ff8b-4fdf-96c1-dd1532b1eb90" TYPE="crypto_LUKS"
$ sudo swapon -a
swapon: cannot open /dev/disk/by-id/dm-uuid-CRYPT-PLAIN-dm_crypt-0: No such file or directory

$ sudo update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-6.11.0-9-generic
cryptsetup: ERROR: dm_crypt-0: Source mismatch
device-mapper: table ioctl on dm_crypt-0  failed: No such device or address
Command failed.
cryptsetup: WARNING: Couldn't determine cipher modules to load for dm_crypt-0
mkinitramfs: copy_file: config '/etc/zfs/vdev_id.conf' not found
mkinitramfs: copy_file: config '/etc/zfs/initramfs-tools-load-key' not found
mkinitramfs: copy_file: config '/etc/zfs/initramfs-tools-load-key.d/*' not found
update-initramfs: Generating /boot/initrd.img-6.8.0-48-generic
cryptsetup: ERROR: dm_crypt-0: Source mismatch
device-mapper: table ioctl on dm_crypt-0  failed: No such device or address
Command failed.
cryptsetup: WARNING: Couldn't determine cipher modules to load for dm_crypt-0
mkinitramfs: copy_file: config '/etc/zfs/vdev_id.conf' not found
mkinitramfs: copy_file: config '/etc/zfs/initramfs-tools-load-key' not found
mkinitramfs: copy_file: config '/etc/zfs/initramfs-tools-load-key.d/*' not found
$ sudo fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 3,64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: CT4000P3SSD8                            
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: gpt
Disk identifier: 8B4A35DE-55EE-4ECA-99B3-E52D0FAC4A75

Device            Start        End    Sectors  Size Type
/dev/nvme0n1p1     2048    2203647    2201600    1G EFI System
/dev/nvme0n1p2  2203648    6397951    4194304    2G Linux filesystem
/dev/nvme0n1p3  6397952   23175167   16777216    8G Linux filesystem
/dev/nvme0n1p4 23175168 7814033407 7790858240  3,6T Linux filesystem
$ lsblk -o +PATH,UUID,PARTUUID
NAME             MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS                         PATH                       UUID                                 PARTUUID
zd0              230:0    0    20M  0 disk                                      /dev/zd0                   2586988a-ff8b-4fdf-96c1-dd1532b1eb90 
└─keystore-rpool 252:0    0     4M  0 crypt /run/keystore/rpool                 /dev/mapper/keystore-rpool bda5d08f-4300-4ecf-9dd1-9c6958d53738 
nvme0n1          259:0    0   3,6T  0 disk                                      /dev/nvme0n1                                                    
├─nvme0n1p1      259:1    0     1G  0 part  /boot/efi                           /dev/nvme0n1p1             6DA7-371B                            604b52dd-b0fc-43d8-8661-3dcb64869220
├─nvme0n1p2      259:2    0     2G  0 part                                      /dev/nvme0n1p2             8036775395222734905                  ec3c6766-9115-4fa6-b9d4-793d092a7bb4
├─nvme0n1p3      259:3    0     8G  0 part                                      /dev/nvme0n1p3                                                  d5018485-33be-40b8-80a1-9adb3c96ff16
└─nvme0n1p4      259:4    0   3,6T  0 part                                      /dev/nvme0n1p4             15673004915406136913                 2157f054-6832-42fb-8032-8d2fb89b235b
$ ls -al /dev/mapper/
crw-------  1 root root 10, 236 Nov 15 22:55 control
lrwxrwxrwx  1 root root       7 Nov 15 22:55 keystore-rpool -> ../dm-0
$ ls -al /dev/disk/by-uuid/
lrwxrwxrwx  1 root root  15 Nov 15 22:54 15673004915406136913 -> ../../nvme0n1p4
lrwxrwxrwx  1 root root   9 Nov 15 22:54 2586988a-ff8b-4fdf-96c1-dd1532b1eb90 -> ../../zd0
lrwxrwxrwx  1 root root  15 Nov 15 22:54 6DA7-371B -> ../../nvme0n1p1
lrwxrwxrwx  1 root root  15 Nov 15 22:54 8036775395222734905 -> ../../nvme0n1p2
lrwxrwxrwx  1 root root  10 Nov 15 22:55 bda5d08f-4300-4ecf-9dd1-9c6958d53738 -> ../../dm-0
$ ls -al /dev/block/
lrwxrwxrwx  1 root root    6 Nov 15 22:55 230:0 -> ../zd0
lrwxrwxrwx  1 root root    7 Nov 15 22:55 252:0 -> ../dm-0
lrwxrwxrwx  1 root root   10 Nov 15 22:55 259:0 -> ../nvme0n1
lrwxrwxrwx  1 root root   12 Nov 15 22:55 259:1 -> ../nvme0n1p1
lrwxrwxrwx  1 root root   12 Nov 15 22:55 259:2 -> ../nvme0n1p2
lrwxrwxrwx  1 root root   12 Nov 15 22:55 259:3 -> ../nvme0n1p3
lrwxrwxrwx  1 root root   12 Nov 15 22:55 259:4 -> ../nvme0n1p4
$ sudo parted /dev/nvme0n1 unit GB print free
Model: CT4000P3SSD8 (nvme)
Disk /dev/nvme0n1: 4001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
        0,00GB  0,00GB  0,00GB  Free Space
 1      0,00GB  1,13GB  1,13GB  fat32              boot, esp
 2      1,13GB  3,28GB  2,15GB  zfs
 3      3,28GB  11,9GB  8,59GB
 4      11,9GB  4001GB  3989GB  zfs
        4001GB  4001GB  0,00GB  Free Space

另外,我不知道这是否相关,但在启动过程中,当提示输入(ZFS 加密)磁盘密码时,我收到以下警告: cryptsetup: WARNING: Option 'size' missing in crypttab for plain dm-crypt mapping dm_crypt-0. Please read /usr/share/doc/cryptsetup-initramfs/README.initramfs.gz and add the correct 'size' option to your crypttab(5).

fstab
  • 2 个回答
  • 242 Views
Martin Hope
DanW58
Asked: 2024-10-21 01:25:21 +0800 CST

在 /etc/fstab 中,“/dev/disk/by-uuid/”和“UUID=”有什么区别?

  • 14

我添加了 3 个要在启动时挂载的分区,但我在其他地方找到的有关新 fstab 语法的建议只与我的 fstab 中现有的两种样式之一一致,这让我非常困惑。我在其他地方找到的建议是,

Entry in /etc/fstab:
<UUID> <mount directory> <FS type> <mount options> <dump> <pass>
Example:
UUID=5caaee32-c3d3-429e-bad7-2898cf923805  /data  ext4  defaults 0 0

但是我的 /etc/fstab 的内容显示,

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/disk/by-uuid/42301925-9786-4ab8-b56c-a3252accf5ef / ext4 defaults 0 1
/dev/disk/by-uuid/F759-075A /boot/efi vfat defaults 0 1
/dev/disk/by-uuid/df063034-c8da-4f14-b1c8-52cdccecc06f /tmp ext4 defaults 0 2
UUID=da0ad11a-8fd7-431a-a49a-d883037aa2c8 /LamaSpace ext4 defaults 0 2
/dev/disk/by-uuid/4acdc978-c30b-4b3f-bbf6-0b7b99094463 /home ext4 defaults 0 2

请注意,只有我的 /LamaSpace 分区使用上面给出的语法;其他分区使用 /dev/disk/by-uuid/ ... 其他语法相同。这两个习语是等效的吗?

额外信息:我使用的是 Ubuntu 24.04。我的所有分区都在一个 8 TB Barracuda HDD 中:

 $ blkid
/dev/sda3: UUID="42301925-9786-4ab8-b56c-a3252accf5ef" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="1f981653-4a7f-48ff-958e-d9e7ec1de51e"
/dev/sda1: UUID="F759-075A" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="91e5f592-dc00-455a-af9a-90c3ba7e914b"
/dev/sda2: UUID="da0ad11a-8fd7-431a-a49a-d883037aa2c8" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="fdcdf7ad-c10b-4a98-b730-7a20db907e91"
/dev/sda4: UUID="4acdc978-c30b-4b3f-bbf6-0b7b99094463" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="7e2715ef-3ae8-44da-8581-bbcc8c59b9a8"
/dev/sda5: UUID="c2bd1f6c-67af-4ea8-98ef-a9c88d92f433" TYPE="swap" PARTUUID="c703710a-6545-49c2-8845-8be9dfc53e2e"
/dev/sda6: UUID="30DD-1315" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="SpareEFI" PARTUUID="eccf77e6-ee55-4f01-bd05-abf9b9dcc24a"
/dev/sda7: UUID="df063034-c8da-4f14-b1c8-52cdccecc06f" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="NEWTEMP" PARTUUID="c752818c-9dd4-453c-9892-fac0db4a2b4a"
/dev/sda8: UUID="89de958a-8997-44e3-92e0-122e1272675c" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Virtual" PARTUUID="bc89cc7e-0798-4ff7-90cd-cfd36aa9cc6e"
/dev/sda9: UUID="73e18c48-92d7-4f37-b55b-da655f461824" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="Sandbox" PARTUUID="5e210dd0-d9fa-4968-a27b-a2753e9c0476"

(我的三个新分区是 sda6、sda8 和 sda9,我手动挂载了它们,但尚未出现在 /etc/fstab 中。)

fstab
  • 1 个回答
  • 641 Views
Martin Hope
White Owl
Asked: 2024-09-15 01:01:14 +0800 CST

升级到 24.04 LTS 后自动挂载不起作用

  • 5

我昨天刚刚从 22.04 LTS 升级到 24.04.1 LTS

我遇到的问题是它不再自动挂载网络驱动器。手动挂载可以正常工作。

在我的记录中/etc/fstab我有如下记录:

10.0.0.12:/Documents  /mnt/Documents  nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
10.0.0.12:/Pictures   /mnt/Pictures   nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0

重启后这些挂载点没有被挂载,但是mount /mnt/Documents可以按预期工作。

在哪里查找?如何修复?

fstab
  • 1 个回答
  • 27 Views
Martin Hope
Omar_Hafez
Asked: 2023-11-11 00:53:24 +0800 CST

从 23.04 升级到 ubuntu 23.10 后:警告!UUID=xxxx 不存在。掉落到贝壳里!

  • 5

一旦我从 Ubuntu 23.04 升级到 23.10,我就无法再启动了!

Gave up waiting for root device. Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
   - Check root= (did the system wait for the right device?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT! UUID=c0fc479f-b1cc-4e85-962b-43a72eec9e91 does not exist. Dropping to a shell!

BusyBox v1.36.1 (Ubuntu 1:1.36.1-3ubuntu1) built-in shell (ash)
Enter 'help' for a lost of built-in commands.
(initramfs)

我确保在BIOS设置中系统配置中的Sata操作是AHCI而不是RAID

我目前正在 live USB 上运行 ubunut。我将文件中的 UUID 更改/etc/fstab为“dev/sdb5”。并update-grub重新启动但没有任何改变!

/etc/fstab:

GNU nano 7.2                       /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/sdb5 during curtin installation
# /dev/disk/by-uuid/c0fc479f-b1cc-4e85-962b-43a72eec9e91 / ext4 defaults 0 1
# /boot/efi was on /dev/sdb1 during curtin installation
#/ dev/disk/by-uuid/1292-A439 /boot/efi vfat defaults 0 1
# UUID=c0fc479f-b1cc-4e85-962b-43a72eec9e91 / ext4 defaults 0 1

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/sdb5       /               ext4    errors=remount-ro    0  1
/swapfile       swap            swap    defaults             0  0
/swap.img       none            swap    sw                   0  0
LABEL=Omar      /mnt/Omar       auto    nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/sdc4       /mnt/sdc4       auto    nosuid,nodev,nofail,x-gvfs-show 0 0

黑子

/dev/sdb5: UUID="c0fc479f-b1cc-4e85-962b-43a72eec9e91" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="a2f6a2d2-f40f-cd41-b4a7-61b12759b403"
/dev/loop1: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/sdd2: SEC_TYPE="msdos" LABEL_FATBOOT="ESP" LABEL="ESP" UUID="6F54-CACE" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="Appended2" PARTUUID="2a585014-a55f-4771-aef0-695c6f9e0059"
/dev/sdd1: BLOCK_SIZE="2048" UUID="2023-10-16-11-29-57-00" LABEL="Ubuntu 23.10.1 amd64" TYPE="iso9660" PARTLABEL="ISO9660" PARTUUID="2a585014-a55f-4771-aef3-695c6f9e0059"
/dev/sdd4: LABEL="writable" UUID="10e8c979-c7d9-4177-8fc4-d35e6e07519e" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="ab5ae46b-1d76-4bc4-89aa-bfdce9a78047"
/dev/loop8: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/sdb4: BLOCK_SIZE="512" UUID="01D9D8E852906F70" TYPE="ntfs" PARTUUID="4be8ef1d-c5da-4121-b27e-7d2b3503538b"
/dev/sdb3: BLOCK_SIZE="512" UUID="01D9D8E850480610" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="64b110ca-af78-4621-80d3-4f19c7181db2"
/dev/sdb1: UUID="1292-A439" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="684257cf-73a2-482d-a9e1-11ce37103972"
/dev/loop6: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop4: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop11: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop2: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop0: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop9: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/sdc1: BLOCK_SIZE="512" UUID="01D9E9BD38CA67E0" TYPE="ntfs" PARTUUID="209e706a-01"
/dev/loop7: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/sda2: UUID="C5B4-CDD0" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="000fa007-bb10-5095-3efd-db2d0e401f00"
/dev/sda1: LABEL="Omar" BLOCK_SIZE="512" UUID="01DA00F083D02BE0" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="f64af970-d8e4-01d9-b878-257b72ecec00"
/dev/loop5: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop12: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop3: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/loop10: BLOCK_SIZE="131072" TYPE="squashfs"
/dev/sdd3: PARTLABEL="Gap1" PARTUUID="2a585014-a55f-4771-aef1-695c6f9e0059"
/dev/sdb2: PARTLABEL="Microsoft reserved partition" PARTUUID="ffb570be-97c1-4b52-ae3a-59c8da2a3101"

fdisk -l

Disk /dev/loop0: 1.62 GiB, 1734254592 bytes, 3387216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 412.77 MiB, 432820224 bytes, 845352 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 776.54 MiB, 814256128 bytes, 1590344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 240.51 MiB, 252190720 bytes, 492560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 73.9 MiB, 77492224 bytes, 151352 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 4 KiB, 4096 bytes, 8 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 11.2 MiB, 11747328 bytes, 22944 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 496.98 MiB, 521121792 bytes, 1017816 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM002-1BD14
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: EC95E2E0-B1C9-03B3-B878-257B72ECEC00

Device         Start       End   Sectors   Size Type
/dev/sda1       4096 523642879 523638784 249.7G Microsoft basic data
/dev/sda2  523642880 976764927 453122048 216.1G Microsoft basic data


Disk /dev/sdb: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SAMSUNG MZ7LN256
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: gpt
Disk identifier: 0E99A25E-4EAC-4265-964D-4D4FF9CF3DD0

Device         Start       End   Sectors   Size Type
/dev/sdb1       2048   4392959   4390912   2.1G EFI System
/dev/sdb2    4392960   4425727     32768    16M Microsoft reserved
/dev/sdb3    4425728 251897855 247472128   118G Microsoft basic data
/dev/sdb4  251897856 253358079   1460224   713M Windows recovery environment
/dev/sdb5  253358080 500117503 246759424 117.7G Linux filesystem


Disk /dev/sdc: 298.09 GiB, 320072933376 bytes, 625142448 sectors
Disk model: SAMSUNG HD322GJ 
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: 0x209e706a

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdc1        2048 625127423 625125376 298.1G  7 HPFS/NTFS/exFAT


Disk /dev/sdd: 28.82 GiB, 30943995904 bytes, 60437492 sectors
Disk model: DataTraveler 3.0
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: gpt
Disk identifier: 2A585014-A55F-4771-AEF2-695C6F9E0059

Device        Start      End  Sectors  Size Type
/dev/sdd1        64 10094759 10094696  4.8G Microsoft basic data
/dev/sdd2  10094760 10104795    10036  4.9M EFI System
/dev/sdd3  10104796 10105395      600  300K Microsoft basic data
/dev/sdd4  10108928 60436479 50327552   24G Linux filesystem


Disk /dev/loop8: 91.69 MiB, 96141312 bytes, 187776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop9: 10.52 MiB, 11026432 bytes, 21536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop10: 40.86 MiB, 42840064 bytes, 83672 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop11: 452 KiB, 462848 bytes, 904 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop12: 130.95 MiB, 137310208 bytes, 268184 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

sdb5(安装 Ubuntu 的位置)上的 SMART 测试结果

smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.5.0-9-generic] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Samsung based SSDs
Device Model:     SAMSUNG MZ7LN256HCHP-000L7
Serial Number:    S20HNXAH205538
LU WWN Device Id: 5 002538 d00000000
Firmware Version: EMT03L6Q
User Capacity:    256,060,514,304 bytes [256 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device
TRIM Command:     Available
Device is:        In smartctl database 7.3/5319
ATA Version is:   ACS-2, ATA8-ACS T13/1699-D revision 4c
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Fri Nov 10 18:03:23 2023 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (    0) seconds.
Offline data collection
capabilities:            (0x53) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    No Offline surface scan supported.
                    Self-test supported.
                    No Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 133) minutes.
SCT capabilities:          (0x003d) SCT Status supported.
                    SCT Error Recovery Control supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   092   092   000    Old_age   Always       -       37035
 12 Power_Cycle_Count       0x0032   096   096   000    Old_age   Always       -       3629
170 Unused_Rsvd_Blk_Ct_Chip 0x0032   100   100   010    Old_age   Always       -       0
171 Program_Fail_Count_Chip 0x0032   100   100   010    Old_age   Always       -       0
172 Erase_Fail_Count_Chip   0x0032   100   100   010    Old_age   Always       -       0
173 Wear_Leveling_Count     0x0033   087   087   005    Pre-fail  Always       -       268
174 Unexpect_Power_Loss_Ct  0x0032   099   099   000    Old_age   Always       -       416
178 Used_Rsvd_Blk_Cnt_Chip  0x0013   100   100   010    Pre-fail  Always       -       0
180 Unused_Rsvd_Blk_Cnt_Tot 0x0013   100   100   010    Pre-fail  Always       -       723
184 End-to-End_Error        0x0033   100   100   097    Pre-fail  Always       -       0
187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0032   070   035   000    Old_age   Always       -       30
199 CRC_Error_Count         0x003e   099   099   000    Old_age   Always       -       1
233 Media_Wearout_Indicator 0x0013   086   086   000    Pre-fail  Always       -       14529068
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       25725
242 Total_LBAs_Read         0x0032   099   099   000    Old_age   Always       -       40003
249 NAND_Writes_1GiB        0x0032   099   099   000    Old_age   Always       -       68640

系统日志文件

https://filetransfer.io/data-package/R92DQfAA#link

更新:

我发现该grub.cfg文件仍然具有 UUID,而不是/dev/sdb5我在fstab文件中提到的。更改 fstab 文件后我更新了组

/boot/grub/grub.cfg

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${initrdfail}" = 2 ]; then
   set initrdfail=
elif [ "${initrdfail}" = 1 ]; then
   set next_entry="${prev_entry}"
   set prev_entry=
   save_env prev_entry
   if [ "${next_entry}" ]; then
      set initrdfail=2
   fi
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function initrdfail {
    if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
      if [ -z "${initrdfail}" ]; then
        set initrdfail=1
        if [ -n "${boot_once}" ]; then
          set prev_entry="${default}"
          save_env prev_entry
        fi
      fi
      save_env initrdfail
    fi; fi
}
function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd1,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5 --hint='hd1,gpt5'  c0fc479f-b1cc-4e85-962b-43a72eec9e91
else
  search --no-floppy --fs-uuid --set=root c0fc479f-b1cc-4e85-962b-43a72eec9e91
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
insmod part_gpt
insmod ext2
set root='hd1,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5 --hint='hd1,gpt5'  c0fc479f-b1cc-4e85-962b-43a72eec9e91
else
  search --no-floppy --fs-uuid --set=root c0fc479f-b1cc-4e85-962b-43a72eec9e91
fi
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_32.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/terminus-18.pf2
insmod jpeg
insmod png
set theme=($root)/usr/share/grub/themes/Vimix/theme.txt
export theme
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=0
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 0 ; then
    set timeout=0
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if [ ${grub_platform} != pc ]; then
      set linux_gfx_mode=keep
    elif hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-c0fc479f-b1cc-4e85-962b-43a72eec9e91' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_gpt
    insmod ext2
    set root='hd1,gpt5'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5 --hint='hd1,gpt5'  c0fc479f-b1cc-4e85-962b-43a72eec9e91
    else
      search --no-floppy --fs-uuid --set=root c0fc479f-b1cc-4e85-962b-43a72eec9e91
    fi
    linux   /boot/vmlinuz-6.5.0-10-generic root=UUID=c0fc479f-b1cc-4e85-962b-43a72eec9e91 ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-6.5.0-10-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-c0fc479f-b1cc-4e85-962b-43a72eec9e91' {
    menuentry 'Ubuntu, with Linux 6.5.0-10-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.5.0-10-generic-advanced-c0fc479f-b1cc-4e85-962b-43a72eec9e91' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5 --hint='hd1,gpt5'  c0fc479f-b1cc-4e85-962b-43a72eec9e91
        else
          search --no-floppy --fs-uuid --set=root c0fc479f-b1cc-4e85-962b-43a72eec9e91
        fi
        echo    'Loading Linux 6.5.0-10-generic ...'
        linux   /boot/vmlinuz-6.5.0-10-generic root=UUID=c0fc479f-b1cc-4e85-962b-43a72eec9e91 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-6.5.0-10-generic
    }
    menuentry 'Ubuntu, with Linux 6.5.0-10-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.5.0-10-generic-recovery-c0fc479f-b1cc-4e85-962b-43a72eec9e91' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5 --hint='hd1,gpt5'  c0fc479f-b1cc-4e85-962b-43a72eec9e91
        else
          search --no-floppy --fs-uuid --set=root c0fc479f-b1cc-4e85-962b-43a72eec9e91
        fi
        echo    'Loading Linux 6.5.0-10-generic ...'
        linux   /boot/vmlinuz-6.5.0-10-generic root=UUID=c0fc479f-b1cc-4e85-962b-43a72eec9e91 ro single recovery nomodeset dis_ucode_ldr 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-6.5.0-10-generic
    }
    menuentry 'Ubuntu, with Linux 6.5.0-9-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.5.0-9-generic-advanced-c0fc479f-b1cc-4e85-962b-43a72eec9e91' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5 --hint='hd1,gpt5'  c0fc479f-b1cc-4e85-962b-43a72eec9e91
        else
          search --no-floppy --fs-uuid --set=root c0fc479f-b1cc-4e85-962b-43a72eec9e91
        fi
        echo    'Loading Linux 6.5.0-9-generic ...'
        linux   /boot/vmlinuz-6.5.0-9-generic root=/dev/sdb5 ro  quiet splash $vt_handoff
    }
    menuentry 'Ubuntu, with Linux 6.5.0-9-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.5.0-9-generic-recovery-c0fc479f-b1cc-4e85-962b-43a72eec9e91' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5 --hint='hd1,gpt5'  c0fc479f-b1cc-4e85-962b-43a72eec9e91
        else
          search --no-floppy --fs-uuid --set=root c0fc479f-b1cc-4e85-962b-43a72eec9e91
        fi
        echo    'Loading Linux 6.5.0-9-generic ...'
        linux   /boot/vmlinuz-6.5.0-9-generic root=/dev/sdb5 ro single recovery nomodeset dis_ucode_ldr 
    }
    menuentry 'Ubuntu, with Linux 6.2.0-36-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.2.0-36-generic-advanced-c0fc479f-b1cc-4e85-962b-43a72eec9e91' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5 --hint='hd1,gpt5'  c0fc479f-b1cc-4e85-962b-43a72eec9e91
        else
          search --no-floppy --fs-uuid --set=root c0fc479f-b1cc-4e85-962b-43a72eec9e91
        fi
        echo    'Loading Linux 6.2.0-36-generic ...'
        linux   /boot/vmlinuz-6.2.0-36-generic root=UUID=c0fc479f-b1cc-4e85-962b-43a72eec9e91 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-6.2.0-36-generic
    }
    menuentry 'Ubuntu, with Linux 6.2.0-36-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.2.0-36-generic-recovery-c0fc479f-b1cc-4e85-962b-43a72eec9e91' {
        recordfail
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod ext2
        set root='hd1,gpt5'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt5 --hint-efi=hd1,gpt5 --hint-baremetal=ahci1,gpt5 --hint='hd1,gpt5'  c0fc479f-b1cc-4e85-962b-43a72eec9e91
        else
          search --no-floppy --fs-uuid --set=root c0fc479f-b1cc-4e85-962b-43a72eec9e91
        fi
        echo    'Loading Linux 6.2.0-36-generic ...'
        linux   /boot/vmlinuz-6.2.0-36-generic root=UUID=c0fc479f-b1cc-4e85-962b-43a72eec9e91 ro single recovery nomodeset dis_ucode_ldr 
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-6.2.0-36-generic
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_linux_zfs ###
### END /etc/grub.d/10_linux_zfs ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/25_bli ###
if [ "$grub_platform" = "efi" ]; then
  insmod bli
fi
### END /etc/grub.d/25_bli ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
    fwsetup --is-supported
    if [ "$?" = 0 ]; then
        menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
            fwsetup
        }
    fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
fstab
  • 1 个回答
  • 4866 Views
Martin Hope
Joseph Oak
Asked: 2022-12-13 01:08:07 +0800 CST

Ubuntu 在启动时不挂载分区(fstab 看起来很奇怪)

  • 6

我整晚都在尝试不同的解决方案,但没有任何效果(磁盘、手动更改等)。

这是在我调整 gparted 上的 sda1 分区大小之后发生的。

首先,这是我的 fstab 现在的样子:

tmpfs /tmp tmpfs nosuid,nodev 0 0
/dev/sda1 /mnt/sda1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/sda3 /mnt/sda3 auto nosuid,nodev,nofail,x-gvfs-show 0 0

我将它设置在磁盘上以安装它,但它无法启动。

这是我验证时得到的错误:

   [W] recommended root FS passno is 1 (current is 0)
/mnt/d22c5008-1a64-4577-8eb7-e760f2f88326
   [E] cannot detect on-disk filesystem type
/mnt/4480B15780B14FE2
   [E] cannot detect on-disk filesystem type

由于磁盘不工作,我怎样才能永久挂载这些分区?我见过不同的 fstab 格式,但我的看起来完全不同。

这是来自 gparted 的 ss。

在此处输入图像描述

fstab
  • 1 个回答
  • 64 Views
Martin Hope
John
Asked: 2022-02-12 11:53:01 +0800 CST

通过 /etc/fstab 中的条目从 NTFS 驱动器挂载子文件夹

  • 1

我有一个 NTFS 硬盘驱动器连接到我的 Raspberry Pi。驱动结构如下:

F:\
- Images
- Other
- Movie

我只想以只读方式挂载 /mnt/disk/Movie 中的 F:\Movie 文件夹。

我的 fstab 看起来像:

UUID=(lots of letters and numbers) Movie /mnt/disk/Movie   ntfs   defaults,uid=0,gid=0,fmask=0022,dmask=0022,noatime,nofail,x-systemd.device-timeout=2

但它不起作用。我究竟做错了什么?

fstab
  • 1 个回答
  • 100 Views
Martin Hope
brec
Asked: 2021-09-11 12:03:16 +0800 CST

GUI Disks 实用程序添加的 fstab 条目似乎格式错误但有效?

  • 2

磁盘实用程序 ( gnome-disks) 在以下位置添加了此条目/etc/fstab:

UUID=[UUID] [mount pount] auto nosuid,nodev,nofail,x-gvfs-show 0 0

基于大量示例和info fstab,auto是文件系统类型(在本例中为 ext4 )应该在的位置,然后auto,用逗号开始选项列表。

但是分区是在启动时安装的,所以auto工作正常。fstab格式松懈吗?磁盘实用程序在格式化方面是否草率?

(为什么我关心:我即将在一个新的硬件系统上安装 Ubuntu 服务器,并想fstab手动添加一个适当的条目。)

fstab
  • 2 个回答
  • 157 Views
Martin Hope
Steve B
Asked: 2021-05-05 22:44:06 +0800 CST

如何为多个用户挂载 SMB 共享

  • 0

我有一个专有的 NAS 服务器,而不是提供 SMB 服务来访问其内容。SMB 协议坚持 V1.0(无法更改)。

我还有一个 ubuntu 20.04 服务器,应该可以访问这个 NAS。具体来说,我使用 NAS 来存储由 Synthing 服务编写的数据副本。也可以从 Windows 计算机访问相同的 NAS。

这是我的 fstab 条目:

//mynashost/SomeShare /mnt/SomeShare cifs    vers=1.0,guest,uid=1000,gid=1000,comment=cloudconfig,iocharset=utf8     0       0

这适用于我的主要用户(uid 1000 和 gid 1000),但不适用于其他用户。具体来说,我的 syncthing 服务正在使用专用用户帐户运行。

此其他用户能够读取内容,但无法写入(权限被拒绝)。

即使使用 sudo,尝试访问chown共享中的文件夹也不起作用(权限被拒绝)。

我对与安全相关的 fstab 选项感到非常困惑。如何修复我的选项,让我的服务器的任何用户读取和写入数据?

由于它是家庭服务器,我不需要隔离每个用户,如果有帮助,匿名安装 NAS 是一种选择。

fstab
  • 1 个回答
  • 2304 Views
Martin Hope
Dante
Asked: 2021-01-03 06:40:48 +0800 CST

fstab 自动创建挂载点

  • 7

如此处所述,“您必须在挂载分区之前创建挂载点。” 但是在 fstab 中添加以下行并重新启动系统后

/dev/sdxy /media/user/hdd_mount_point ext4 defaults 0 0
tmpfs /mnt/tmpfs_mount_point tmpfs rw,nosuid,noatime,nodev,size=4G,mode=1777 0 0

挂载点(目标目录)hdd_mount_point,tmpfs_mount_point如果它们不存在则自动创建。我知道如果它不存在,您可以通过在其手册页中向命令添加X-mount.mkdir选项来创建挂载点,但我真的很想知道在通过 fstab 挂载文件系统时是否隐式使用此选项。mount

不,它不是自动将文件系统添加到 /etc/fstab的副本

fstab
  • 2 个回答
  • 5711 Views
Martin Hope
acgbox
Asked: 2020-12-22 13:56:17 +0800 CST

mount ntfs 中的权限选项

  • 0

我最近阅读了有关在 linux 中安装 NTFS 分区的答案,以便我可以更改文件和文件夹权限(chmod)。他们解释说我使用“权限”选项。例子:

# fstab
UUID=12102C02102CEB83 /mount_point  ntfs-3g  defaults,permissions 0 0

# manual
sudo mount /dev/sdax -t ntfs-3g -o permissions /mount_point

并且有效,但是我检查了man fstab和man mount并且找不到“权限”选项。网上搜了一下,很少有地方提到,但没有链接到来源

有人能告诉我这个选项来自哪里吗?(提供解释此选项的官方链接)。谢谢

fstab permissions partitioning mount ntfs
  • 1 个回答
  • 926 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve