Should I unmount usb external drive partitions before shutting down?

Message
Author
User avatar
Kester
Posts: 374
Joined: Tue Aug 09, 2022 10:39 am

Should I unmount usb external drive partitions before shutting down?

#1 Post by Kester »

Hi,

Since posting about setting up a new external usb hard drive, I wondered if it is necessary/wise to unmount the partitions before a standard shutdown. I wish the drive to be continually available when the PC is running (as if it were an internal device) so that it is loaded and accessible immediately after booting. If the shutdown process effectively unmounts the connected external drive then I guess I don't need to unmount the partitions but I would appreciate advice on the matter.

Cheers

User avatar
BV206
Posts: 475
Joined: Sat Mar 09, 2019 10:55 am

Re: Should I unmount usb external drive partitions before shutting down?

#2 Post by BV206 »

As far as I know when you shut down linux properly, with the menu item in MX or "shutdown" command in a terminal, all file systems are unmounted. If the drive is busy you might see a delay while whatever is writing to it finishes before the system shuts down.

User avatar
Kester
Posts: 374
Joined: Tue Aug 09, 2022 10:39 am

Re: Should I unmount usb external drive partitions before shutting down?

#3 Post by Kester »

Thanks BV206, I suspected things were as you suggest. Actually I've discovered, that for some reason I cannot unmount those partitions without using my password. I'm not sure why my chown -R user:user /media/drivename terminal commands seem to have worked for everything else but not permission for unmount - probably I've missed something or misunderstood something.

User avatar
bin
Posts: 68
Joined: Sun Aug 30, 2009 1:53 am

Re: Should I unmount usb external drive partitions before shutting down?

#4 Post by bin »

Personally I always ensure any external drive has been ejected and disconnected before shut down.
It goes back to the days of supporting an office full of sales types who were always rushing to get Powerpoints and other stuff on to USB keys before they dashed off to some meeting somewhere.
Invariably there was always one who would think they had saved the file, they'd either just pull the drive or just switch off because there were outstanding windows updates they'd been putting off.
Eventually I got them all drilled into Save it, copy it to the key, eject the key and then shutdown.

Old habits die hard but it got round the frantic call from a meeting somewhere - "I can't open my presentation!!!!!"

User avatar
wdscharff
Posts: 1090
Joined: Mon Feb 24, 2020 1:07 am

Re: Should I unmount usb external drive partitions before shutting down?

#5 Post by wdscharff »

Half of my drives included in fstab are external USB drives, simply because I don't have the space in the case. I have never worried about this because the system first terminates all file operations during shutdown, whether internal or external, before it switches off.
my working horse Desktop AMD Ryzen 9 3900x, 32GB Ram // SSD ... enough
mx-fluxbox, what else?

In nature there are neither rewards nor punishments.
There are consequences.


my wallpaper gallery

User avatar
Kester
Posts: 374
Joined: Tue Aug 09, 2022 10:39 am

Re: Should I unmount usb external drive partitions before shutting down?

#6 Post by Kester »

@ wdscharff ,
Thanks for your reassuring comments. It's good not to have to go through the unmounting procedure at each shutdown. However, I wonder if I have not completed something in the drive setting-up correctly as I get the following message when I try to unmount a partition for example:
Authentication is required to unmount WDcC WD408DGZ-115LVBO (/dev/sdc6) mounted by another user.
An application is attempting to perform an action that requires privileges.
Authentication is required for this action.
Password:
I had used the command 'sudo chown -R chris:chris/media/chris/elements06' for each partition during setting up and I have no problems reading and writing to the partitions (chris being the username and elements06 the partition name in this example).
The relevant fstab entries are:
#Entry for /dev/sdc1 :
UUID=D07A92967A9278C4 /media/chris/Elements ntfs-3g defaults,uid=1000,gid=100,dmask=0002,fmask=0113,utf8,x-gvfs-show,nodev,nosuid 0 0
#Entry for /dev/sdc6 :
UUID=5641C3DA1A11F73C /media/chris/Elements06 ntfs-3g defaults,uid=1000,gid=100,dmask=0002,fmask=0113,utf8,x-gvfs-show 0 0
#Entry for /dev/sdc5 :
UUID=acdd3e59-fba4-4a01-8859-9324a78e2814 /media/chris/Elements05 ext4 defaults,x-gvfs-show 0 0
#Entry for /dev/sdc4 :
UUID=1df182c3-6dde-407c-a1b2-28f54672e407 /media/chris/Elements04 ext4 defaults,x-gvfs-show 0 0
#Entry for /dev/sdc3 :
UUID=771048D959F3EFD5 /media/chris/Elements03 ntfs-3g defaults,uid=1000,gid=100,dmask=0002,fmask=0113,utf8,x-gvfs-show,nodev,nosuid 0 0
#Entry for /dev/sdc2 :
UUID=5BDCB76670C21B39 /media/chris/Elements02 ntfs-3g defaults,uid=1000,gid=100,dmask=0002,fmask=0113,utf8,x-gvfs-show,nodev,nosuid 0 0
Obviously I can unmount the partitions if I need to by using my password but I just wonder if I have done something incorrectly or what I am experiencing is normal behaviour.
Cheers.

txm0523
Posts: 148
Joined: Sat Oct 06, 2018 5:34 pm

Re: Should I unmount usb external drive partitions before shutting down?

#7 Post by txm0523 »

Just had a recent experience where I went and attached an external HDD and I got errors when trying to read the external HDD. I posted about this and discovered that it was a NTFS problem. What I did to correct it was to remove internal HDD from laptop with MX Linux on it. Installed a new internal HDD and loaded MS Win 10 on it. Booted up Win 10. Then when I attached the external HDD, Windows said there was a problem and offered to fix, which it did. Then I removed external HDD after Win 10 shut down, then I removed internal HDD with Win 10 on it, re-installed the internal HDD with MX Linux on it, booted up the laptop, then attached the external HDD and Linux was able to read the drive and all my files were still on it. What had happened was I was working on a spreadsheet file from the external HDD, then I decided to do the updates without getting out of the spreadsheet or safely removing it. After the system updated, that's when the external HDD got corrupted somehow. Moral of the story, I will always safely remove the external HDD before I shut down system or do updates. Don't want to go through that experience again.

User avatar
wdscharff
Posts: 1090
Joined: Mon Feb 24, 2020 1:07 am

Re: Should I unmount usb external drive partitions before shutting down?

#8 Post by wdscharff »

Problems with NTFS formatted disks, especially in connection with Win 10/11, whose quick start options, I have no idea of. When I finally switched from win7 to Linux (2014/15), everything was formatted to ext4.
my working horse Desktop AMD Ryzen 9 3900x, 32GB Ram // SSD ... enough
mx-fluxbox, what else?

In nature there are neither rewards nor punishments.
There are consequences.


my wallpaper gallery

User avatar
Kester
Posts: 374
Joined: Tue Aug 09, 2022 10:39 am

Re: Should I unmount usb external drive partitions before shutting down?

#9 Post by Kester »

@txm0523 and @wdscharff,
My external drive has six partitions (4 ntfs and 2 ext4). None can be unmounted without my user password. Other than that everything is working fine including when I boot up the system each morning. I need ntfs partitions for access from a guest XP system in VirtualBox and the four ntfs partitions on the external drive are working well with that so far at least. What interests me is why can I not set any of the external drive's partitions to unmount directly by the user.

Post Reply

Return to “Hardware /Configuration”