You are not logged in.
Pages: 1
Hello.
I installed Arch Linux on an external hard drive and I can't figure out how to safely unmount it, since I am booting into it. Usually, for external hdd that I use only for copying/pasting data, I use combination of umount and udisksctl to unmount and eject it. Now, I can't use it since the external drive in question is the one that I am booting, meaning that it is still being used, and powering it off will end with a head parking sound. I also got an error about bad drive sector which, I think, is linked to the repeated head parking during power off.
I have followed this solution but it doesn't fix my problem. I think that it is because they aren't booting from the external drive and a lot of similar problems with solutions that I found doesn't address the situation of booting directly from external drive. Is there a way to safely unmount my drive during power off?
Additional info:
File foo.shutdown in /usr/lib/systemd/system-shutdown
#!/usr/bin/zsh
hdparm -Y /dev/sdbsmartctl -a /dev/sdb/ output
pastebin
Offline
Here is an idea. Don't know how feasible it is.
Create a systemd service that depends on or is a dependency of the sytemd mount unit for your root partition (see "systemctl status -- -.mount"). Put the udiskctl command in the systemd service to eject the drive and have it run that command when that mount unit stops.
Last edited by willemw (2023-09-26 05:53:10)
Offline
You'll end with the emergency retracts because usb is shut down while the root partition is still in use.
Idling it won't help.
Can you "systemctl halt" instead of poweroff?
Online
Here is an idea. Don't know how feasible it is.
Create a systemd service that depends on or is a dependency of the sytemd mount unit for you root partition (see "systemctl status -- -.mount"). Put the udiskctl command in the systemd service to eject the drive and have it run that command when that mount unit stops.
Thanks for your input. Since it seems more involved, I'll keep that in mind and do it when I get deeper with systemd.
Offline
You'll end with the emergency retracts because usb is shut down while the root partition is still in use.
Idling it won't help.Can you "systemctl halt" instead of poweroff?
https://i.stack.imgur.com/jbD97.png
I tried systemctl halt and it works in the sense that my external drive doesn't do head parking, but, still, it isn't power off.
Last edited by archery_64 (2023-09-26 05:31:37)
Offline
No, you'll have to push the power button and manually turn off the system - or do you mean that the USB drive is still spinning by the end of this?
The head should™ rest at some point.
Online
Just thinking out load without figuring out how to implement this just yet ---
What about creating a file system image that has a very basic root partition and loading it to a RAM disk. Then chroot into it, dismount the external drive, and shut down from inside the chroot?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Pages: 1