Ejecting eSATA & SATA drives.
I have a SATA to SATA drive caddy taking up one of my 5.25" bays so that I can hot-swap my SATA drives on the fly.
Since Linux saw the drive as internal (how would it know?) normal users can't mount any of the partitions. I fixed that with udev: Code:
udevadm info -q path -n /dev/sdb After doing some research on the Internet I came across this set of commands to safely eject an eSATA/SATA drive: Code:
# replace all instances of sdb with the relevant drive Is there any way to eject a SATA drive that a standard user could utilize without sudo privileges? Kinda like with USB flash drives? Relevant installed software: Debian 7.5 amd64 LXDE desktop (full install) pcmanfm gnome-disk-utility |
Hey Archy,
From the eject man page Quote:
|
Quote:
|
Code:
$ eject -v /dev/sdb Code:
# eject -v /dev/sdb |
Hi Archy
Could you post the output of the mount command (just "#mount", you don't have to sudo to run it) as well as your /etc/fstab? How many partitions on this disk have mount points in the local file system? The other thing I'm wondering is, mounting and umounting are one thing, removing a drive from powered bay is another. Once you've umounted the partitions on sdb, the files system wont care what happens to them however the hard drive may not react well to being powered down like that. If you've already thought of that and made allowances (tolerant drives, for example) don't worry about it. |
Output of mount with sdb inserted, powed on, and unmounted:
Code:
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) Code:
# /etc/fstab: static file system information. Quote:
Quote:
|
It's seeing the drive as a multi-partition, so I was just wondering are we trying to umount a single mount point of a multi-mount drive (sdb1 is /home, sdb2 is /usr/local/, sdb3 is...etc) and that's why it's failing.
Did you try to run eject against the mount point in /media? The reason I keep coming back to eject is hdparm and ioctls are both going to require root access, so it seems like we're going to have to find a way to do this with "eject" if you're going to get it working for average users. |
Quote:
QUESTIONS: If all partitions are unmounted, would it be safe to just cut the power to the drive and then remove it? Quote:
Code:
$ eject -v /media/63537a60-caf0-4c35-9de7-78c8540828f4/ Example of USB eject: Code:
$ eject -v /dev/sdc Quote:
Let's try it on a SATA drive: Code:
$ udisks --detach /dev/sdb Code:
$ udisks --detach /dev/sdc Code:
udevadm info -q path -n /dev/sdb |
All times are GMT -5. The time now is 01:54 AM. |