[nflug] Flushing a USB drive (and mounting a second partition from my desktop)

Joe josephj at main.nc.us
Sun Mar 16 15:05:51 EDT 2008


Today when I turned on my notebook, no usb drives appeared on the
desktop.  I just unplugged the usb connector to the drive and plugged it
in again and both partitions appeared as icons.

I worked on this last night.  One improvement was to use e2label to name
the Linux partition so I'd (visually) recognize it when it appears.  I
created /media/linusb.  Then I added two links to application on my
desktop.  One runs the following:

kdesu 'mount -U b6ab9b01-cac5-4e11-b3b2-2d279deccf39 /media/linusb'

The other runs

kdesu 'umount /media/linusb'

These work.

But the icon that "appears" on my desktop to mount the Linux partition
is now set to use /media/linusb2.  (it remembers this setting from last
night, but I have no idea where it saved this information.)  When I told
it to use /media/linusb, it said that it couldn't - already in use.  So
the two methods use different mount points and that will complicate any
scripts etc. that I write to reference the partition.

I also tried to create a link to device on my desktop (instead of the
two links to applications above), but couldn't get that to work.

Also, the icon that "appears" for the Linux partition has a check box
for "automatically mount".  I don't know how that would work if the
drive is unplugged.  Any ideas?

I also took a stab at adding a line for the drive to fstab, but when I
did (possibly done wrong), I couldn't get it to mount at all from any of
the icons, so I deleted that entry.

Here's my fstab:

# /etc/fstab: static file system information.
#
#  -- This file has been automatically generated by ntfs-config --
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

proc /proc proc defaults 0 0
# Entry for /dev/sda4 :
UUID=c171912f-5148-41b9-a2e3-70a68361cc57 / ext3
defaults,errors=remount-ro 0 1
# Entry for /dev/sda6 :
UUID=0deaaf4c-bacb-4644-a3f1-96c46c1b8844 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/sda1 /media/windoze ntfs-3g
auto,rw,gid=1002,umask=0002,locale=en_US.utf8 0 0
bigbird at sananda:~$

TIA

Joe

Cyber Source wrote:
> I would like to see your /etc/fstab
>
> Joe wrote:
>> Joe wrote:
>>  
>>> Replies inline.
>>>
>>> Joe
>>>
>>> Cyber Source wrote:
>>>      
>>>> <so I wouldn't be sure what
>>>> unmounting it (Safely Remove  - option) would do relative to the
>>>> second
>>>> partition.>
>>>> HUH?
>>>>           
>>> When I plug in my USB Drive, I get an icon on the desktop which allows
>>> me to mount and unmount the first partition (the Windoze one) of the
>>> drive.  There is no similar icon/option for the second partition
>>> (Linux), so I don't know of any way to mount/unmount it other than by
>>> using the command line.  I can do command line, but if someone else
>>> (non-technical) is using the system, I don't want them anywhere near
>>> the
>>> command line.  Other than my convenience, that's what this whole
>>> discussion is about.
>>>      
>>>> <BTW, do you know how to get a usb drive to always be the same /dev...
>>>> even when it's plugged into a different usb port or plugged in after
>>>> something else?>
>>>> That's what UUID's are all about.
>>>>           
>>> Yes.  I just learned about that working on repartitioning my drive.
>>>      
>>>> Joe wrote:
>>>>          
>>>>> Cyber Source wrote:
>>>>>  
>>>>>              
>>>>>> udev should handle the second partition as it does the first. Have a
>>>>>> look in your /etc/fstab file for a conflicting entry relative to the
>>>>>> partition that's not automounting, you most likely have a
>>>>>> conflicting
>>>>>> entry in there with the "noauto" option. I'm a gnome guy but I'm
>>>>>> sure
>>>>>> if you right click on the icon in kde, you'll get a eject/unmount
>>>>>> option for the drive just like in windows.
>>>>>>
>>>>>> Joe wrote:
>>>>>>                     
>>>>>>> I have a USB 250GB hard disk with two partitions on it.  One is for
>>>>>>> Windoze and one for Linux.
>>>>>>>
>>>>>>> When I plug it into the usb socket, kubuntu/kde puts an icon on my
>>>>>>> desktop for the first partition on the drive (which happens to
>>>>>>> be the
>>>>>>> windows one).
>>>>>>>
>>>>>>> I can mount the second partition (Linux) manually using sudo mount
>>>>>>> /dev/sdb2 /media/linusb
>>>>>>>
>>>>>>> * How can I get the second partition to mount just like the
>>>>>>> first one
>>>>>>> does - with no fuss?
>>>>>>>
>>>>>>> * When I want to unplug the drive, how do I flush it (assure
>>>>>>> that all
>>>>>>> writes have completed)?  For the Windoze partition, I just
>>>>>>> right-click
>>>>>>> on the desktop disk icon and select "safely remove".
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>> Joe
>>>>>>> _______________________________________________
>>>>>>> nflug mailing list
>>>>>>> nflug at nflug.org
>>>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>>>                               
>>>>>> _______________________________________________
>>>>>> nflug mailing list
>>>>>> nflug at nflug.org
>>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>>
>>>>>>                       
>>>>> That might work, but I'm not sure since clicking on the icon only
>>>>> mounts
>>>>> the first partition (as far as accessing it), so I wouldn't be
>>>>> sure what
>>>>> unmounting it (Safely Remove  - option) would do relative to the
>>>>> second
>>>>> partition.
>>>>>
>>>>> I used to sort of know my way around fstab in Mandrake 9.1, but this
>>>>> stuff about UUID ... is completely new.
>>>>> The drive itself becomes /dev/sdb1 and /dev/sdb2 when connected and I
>>>>> don't think anything in fstab references that at all.
>>>>>
>>>>> BTW, do you know how to get a usb drive to always be the same /dev...
>>>>> even when it's plugged into a different usb port or plugged in after
>>>>> something else?
>>>>>
>>>>> Thanks.
>>>>>
>>>>> Joe
>>>>>
>>>>> fstab:
>>>>>
>>>>> bigbird at sananda:/etc$ cat fstab
>>>>> # /etc/fstab: static file system information.
>>>>> #
>>>>> #  -- This file has been automatically generated by ntfs-config --
>>>>> #
>>>>> # <file system> <mount point>   <type>  <options>       <dump> 
>>>>> <pass>
>>>>>
>>>>> proc /proc proc defaults 0 0
>>>>> # Entry for /dev/sda4 :
>>>>> UUID=c171912f-5148-41b9-a2e3-70a68361cc57 / ext3
>>>>> defaults,errors=remount-ro 0 1
>>>>> # Entry for /dev/sda6 :
>>>>> UUID=0deaaf4c-bacb-4644-a3f1-96c46c1b8844 none swap sw 0 0
>>>>> /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
>>>>> /dev/sda1 /media/windoze ntfs-3g
>>>>> auto,rw,gid=1002,umask=0002,locale=en_US.utf8 0 0
>>>>>
>>>>> _______________________________________________
>>>>> nflug mailing list
>>>>> nflug at nflug.org
>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>                 
>>>> _______________________________________________
>>>> nflug mailing list
>>>> nflug at nflug.org
>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>
>>>>           
>>> _______________________________________________
>>> nflug mailing list
>>> nflug at nflug.org
>>> http://www.nflug.org/mailman/listinfo/nflug
>>>
>>>       
>> When I manually mount the second partition, I now see an icon for it
>> appear on the desktop.  This has an option for safely remove.  So that
>> problem is solved, but mounting the partition from the desktop is still
>> an issue.
>>
>> Joe
>> _______________________________________________
>> nflug mailing list
>> nflug at nflug.org
>> http://www.nflug.org/mailman/listinfo/nflug
>>   
> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
>



More information about the nflug mailing list