在辅助硬盘驱动器中新创建的主目录在重新启动后不断卸载,fstab 不起作用

在辅助硬盘驱动器中新创建的主目录在重新启动后不断卸载,fstab 不起作用

我买了一个新硬盘并将我的家搬到那里。我已经关注了这个链接:https://www.howtogeek.com/442101/how-to-move-your-linux-home-directory-to-another-hard-drive/

但是新硬盘在重新启动期间不断卸载,我总是必须运行mount -a命令。我无法从 中删除旧的 /home 条目/etc/fstab

重要的是要指出我的第一个硬盘驱动器已加密。

新的硬盘是/dev/sda1.

blkid /dev/sda1给出/dev/sda1: UUID="b9e91410-03ef-48d5-a8af-06837f2f0aae" UUID_SUB="285e8dea-340a-478c-9b20-cb09d4ee8485" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="ba042bba-01".

这是我的/etc/fstab文件:


#
# /etc/fstab
# Created by anaconda on Thu Feb 18 09:11:13 2021
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=621d28d8-16de-44e8-b733-1dab40daea02 /                       btrfs   subvol=root,x-systemd.device-timeout=0 0 0
UUID=03011415-2410-443a-a923-ce1154ea8ea3 /boot                   ext4    defaults        1 2
UUID=3D2C-76FF          /boot/efi               vfat    umask=0077,shortname=winnt 0 2
UUID=621d28d8-16de-44e8-b733-1dab40daea02 /home                   btrfs   subvol=home,x-systemd.device-timeout=0 0 0
UUID=b9e91410-03ef-48d5-a8af-06837f2f0aae /home btrfs rw,seclabel,relatime,ssd,space_cache=v2,subvolid=5,subvol=/ 0 0


这是我的/proc/mounts文件:

proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=4096k,nr_inodes=131072,mode=755,inode64 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev,inode64 0 0
devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,seclabel,nosuid,nodev,size=3187696k,nr_inodes=819200,mode=755,inode64 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,seclabel,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
pstore /sys/fs/pstore pstore rw,seclabel,nosuid,nodev,noexec,relatime 0 0
efivarfs /sys/firmware/efi/efivars efivarfs rw,nosuid,nodev,noexec,relatime 0 0
bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
/dev/mapper/luks-76241767-67a8-4d40-aafc-25eb50a2e22a / btrfs rw,seclabel,relatime,ssd,space_cache,subvolid=257,subvol=/root 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,nosuid,noexec,relatime 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=31,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=21597 0 0
mqueue /dev/mqueue mqueue rw,seclabel,nosuid,nodev,noexec,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,relatime,pagesize=2M 0 0
tracefs /sys/kernel/tracing tracefs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /tmp tmpfs rw,seclabel,nosuid,nodev,nr_inodes=1048576,inode64 0 0
/dev/mapper/luks-76241767-67a8-4d40-aafc-25eb50a2e22a /home btrfs rw,seclabel,relatime,ssd,space_cache,subvolid=256,subvol=/home 0 0
/dev/loop3 /var/lib/snapd/snap/core18/2785 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop0 /var/lib/snapd/snap/core18/2721 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop8 /var/lib/snapd/snap/core22/817 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop4 /var/lib/snapd/snap/core/15511 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop5 /var/lib/snapd/snap/core20/1852 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop7 /var/lib/snapd/snap/core22/607 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop1 /var/lib/snapd/snap/core/14946 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop2 /var/lib/snapd/snap/atomify/153 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop6 /var/lib/snapd/snap/core20/1974 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop9 /var/lib/snapd/snap/gnome-3-28-1804/198 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop10 /var/lib/snapd/snap/gnome-3-38-2004/119 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop11 /var/lib/snapd/snap/gnome-3-38-2004/137 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop13 /var/lib/snapd/snap/gnome-42-2204/87 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop12 /var/lib/snapd/snap/gnome-42-2204/120 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop15 /var/lib/snapd/snap/gtk-common-themes/1535 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop17 /var/lib/snapd/snap/signal-desktop/493 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop18 /var/lib/snapd/snap/rubymine/334 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop16 /var/lib/snapd/snap/signal-desktop/428 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop14 /var/lib/snapd/snap/gtk-common-themes/1534 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop19 /var/lib/snapd/snap/rubymine/351 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop20 /var/lib/snapd/snap/snapd/17950 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop21 /var/lib/snapd/snap/snapd/19457 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop22 /var/lib/snapd/snap/xournalpp/69 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/loop23 /var/lib/snapd/snap/xournalpp/82 squashfs ro,context=system_u:object_r:snappy_snap_t:s0,nodev,relatime,errors=continue 0 0
/dev/nvme0n1p2 /boot ext4 rw,seclabel,relatime 0 0
/dev/nvme0n1p1 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run/user/1000 tmpfs rw,seclabel,nosuid,nodev,relatime,size=1593844k,nr_inodes=398461,mode=700,uid=1000,gid=1000,inode64 0 0
portal /run/user/1000/doc fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
/dev/sda1 /home btrfs rw,seclabel,relatime,ssd,space_cache=v2,subvolid=5,subvol=/ 0 0

我的/etc/mtab文件是空的。

答案1

存在权限问题。我已重置主分区安装点及其目录上的安全标签。

su

restorecon -v /home /home/*

相关内容