로컬 파일 시스템 마운트 후 바인드 마운트

로컬 파일 시스템 마운트 후 바인드 마운트

물리적 파일 시스템을 마운트한 후에만 바인드 마운트를 설치하고 싶습니다. 파일 시스템 중 하나는 비밀번호 LUKS로 암호화되어 있으므로 수동으로 마운트해야 하기 때문에 이는 더욱 중요합니다.

이를 달성하기 위한 내 생각은 다음과 같습니다.

# Filesystem mounts
# This one is mounted automatically since it's using a key
/dev/mapper/sandssd_crypt /mnt/drive1 btrfs defaults,compress-force=zstd,space_cache,ssd,noatime,nofail 0 2
# This one needs to be mounted manually with a password
/dev/mapper/320gbhdd /mnt/drive2 ext4 defaults,noatime,nofail 0 2


# Bind mounts
#/mnt/drive1/files /srv/nfs/files none x-systemd.requires=/mnt/drive1,x-systemd.automount,bind 0 2
#/mnt/drive2/files /srv/nfs/files2 none x-systemd.requires=/mnt/drive2,x-systemd.automount,bind 0 2

이것이 이것을 달성하는 좋은 방법입니까 x-systemd.requires=, 아니면 내가 원하는 방식으로 작동하지 않습니까?

답변1

또 다른 옵션은 바인딩하려는 마운트를 루프하고 찾는 스크립트를 rc.local에서 생성하는 것입니다. 이를 발견하면 바인딩하고 종료할 수 있습니다.

systemd의 borg가 태양계를 둘러싸기 전에 Linux는 원하는 방식으로 작업하기가 훨씬 쉽고 간단했습니다. 한숨.

관련 정보