You are not logged in.

#1 2008-10-23 03:02:10

DePingus
Member
From: Miami, Fl
Registered: 2008-09-07
Posts: 44

[SOLVED] what is the correct way to unmount usb

Hi there folks,

I have a quick question about unmounting a usb flash drive.

I'm using UDEV rules to auto mount my usb flash drive as described here (symlinking /media to /mnt):
http://wiki.archlinux.org/index.php/Ude … SB_devices

What is the correct way to unmount the drive? I noticed the udev rules have some lines with umount, throw in the symlinking and I'm a little confused.

I'm using OpenBox with Thunar as my file manager (currently not managing volumes).

Many thanks!

Last edited by DePingus (2008-10-23 16:49:27)

Offline

#2 2008-10-23 05:06:57

cemsbr
Member
From: Brazil
Registered: 2008-05-03
Posts: 111
Website

Re: [SOLVED] what is the correct way to unmount usb

I read the wiki and I found the options "sync,dirsync" when mounting. It means filesystem changes will be done immediately, so you can unplug the usb flash drive if you are not waiting for a cp, rm or something like that to finish its job. Then the umount in udev will just tell that the drive is not available anymore. Notice that synchronous I/O are slower and may cause life-cycle shortening ("man mount" and search for "sync").

If it is mounted with "async", you must umount (or eject) your usb flash drive before unplugging it, otherwise its data may become corrupted because all changes are not immediately written to the drive (it is possible to have changes commited just after entering umount or eject). Running "sync" also writes the changes to the drive, but doesn't umount it.

Offline

#3 2008-10-23 10:32:09

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [SOLVED] what is the correct way to unmount usb

Stop fighting it and use nautilus. The new version is great smile


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#4 2008-10-23 11:29:11

smakked
Member
From: Gold Coast , Australia
Registered: 2008-08-14
Posts: 420

Re: [SOLVED] what is the correct way to unmount usb

moljac024 wrote:

Stop fighting it and use nautilus. The new version is great smile

+`1 on that


Certified Android Junkie
Arch 64

Offline

#5 2008-10-23 15:31:46

DePingus
Member
From: Miami, Fl
Registered: 2008-09-07
Posts: 44

Re: [SOLVED] what is the correct way to unmount usb

Thanks for the replies! Thats exactly what I needed to know cemsbr.

As for Nautilus...
I had no probs with Thunar and its volume manager in OpenBox. But I need to have an external drive mounted on boot before mpd loads, so I decided to use udev rules to manage my removable media.

I might make a udev rule or fstab entry to handle that just that external drive and then use Thunar's (or Nautilus's roll ) volume manager for everything else. Haven't sat down to explore that route yet...

Any suggestions as to which would be best for a an external drive (enclosure with a real hard drive inside connected via firewire)?

Offline

Board footer

Powered by FluxBB