Score:0

`findmnt` and `ls` still see a physically disconnected external storage drive

ธง in

Here is an /etc/fstab record example of one of the mounts as per x-systemd.automount and other goodies:

UUID=XXXX-XXXX /media/XXXX-XXXX auto noauto,nofail,nouser,uid=root,gid=users,umask=007,X-mount.mkdir,x-systemd.automount,x-systemd.device-timeout=1,x-systemd.idle-timeout=60 0 2

Currently this external exFAT-formatted drive is physically disconnected from the PC, but I still get the following surprises

$ ls /media
ls: cannot access '/media/XXXX-XXXX': No such device

and

$ findmnt /media/XXXX-XXXX
TARGET           SOURCE    FSTYPE OPTIONS
/media/XXXX-XXXX systemd-1 autofs rw,relatime,fd=55,pgrp=1,timeout=60,minproto=5,maxproto=5,direct,pipe_ino=24590

This obviously fools other software, which might potentially be using findmnt to determine whether the mount is up, to believe that the storage drive is actually mounted and to proceed with further actions.

How do I make sure that when the drive is physically disconnected, it is no longer considered by the Linux system?

djdomi avatar
za flag
ดูเหมือนว่าฉันยังติดตั้งสื่อ tgat อยู่ใช่ไหม
in flag
@djdomi ไม่ใช่เลย บันทึกที่คุณเห็นนั้นสะท้อนถึงความสัมพันธ์ของ `fstab` และ `systemd` ไม่มีการเมานต์จริงใน `เมานต์`, `df`, `lsblk` เป็นต้น
djdomi avatar
za flag
คุณลอง `eject` หรือ `udisks --detach /dev/sdX` หรือ `udisksctl power-off -b /dev/sdb` โดยอ้างอิงถึง [โพสต์นี้] (https://unix.stackexchange.com/questions/ 35508/eject-usb-drives-eject-command/129282)
in flag
@djdomi ปัญหาของสิ่งนี้คือไม่มีอุปกรณ์ที่จะเริ่มต้น อุปกรณ์หายไปและนั่นคือสิ่งที่ `ls` บ่นเกี่ยวกับตัวอย่าง `lsblk` ยังไม่ได้ให้ข้อมูลเชิงลึก แน่นอนฉันจำได้ว่าอุปกรณ์ชื่ออะไร และฉันพยายามป้อนด้วยตนเองในคำสั่ง `eject' ซึ่งเป็นผลตามธรรมชาติใน `eject: /dev/sdd: not found mountpoint or device with the given name` ข้อความแสดงข้อผิดพลาด
djdomi avatar
za flag
UUID=XXXX-XXXX /media/XXXX-XXXX เป็น X anomized หรือไม่
in flag
@djdomi ใช่แล้ว ในความเป็นจริงตัวอักษรต่างกัน แต่นั่นไม่เกี่ยวข้องที่นี่
djdomi avatar
za flag
ทำไมคุณทำเช่นนี้? นั่นเป็นความลับเหรอ?

โพสต์คำตอบ

คนส่วนใหญ่ไม่เข้าใจว่าการถามคำถามมากมายจะปลดล็อกการเรียนรู้และปรับปรุงความสัมพันธ์ระหว่างบุคคล ตัวอย่างเช่น ในการศึกษาของ Alison แม้ว่าผู้คนจะจำได้อย่างแม่นยำว่ามีคำถามกี่ข้อที่ถูกถามในการสนทนา แต่พวกเขาไม่เข้าใจความเชื่อมโยงระหว่างคำถามและความชอบ จากการศึกษาทั้ง 4 เรื่องที่ผู้เข้าร่วมมีส่วนร่วมในการสนทนาด้วยตนเองหรืออ่านบันทึกการสนทนาของผู้อื่น ผู้คนมักไม่ตระหนักว่าการถามคำถามจะมีอิทธิพลหรือมีอิทธิพลต่อระดับมิตรภาพระหว่างผู้สนทนา