새 하드 드라이브를 구입하고 집을 그곳으로 옮겼습니다. 나는 다음 링크를 따라갔습니다.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/*