LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 01-22-2005, 09:34 AM   #1
Klas
Member
 
Registered: Oct 2003
Location: Uppsala, Sweden
Distribution: Mandrake 9.1, Mandrake 10.0
Posts: 77

Rep: Reputation: 15
Unmount a memory stick


Hi
Just bought a new Kingstom USB memory. It gets automounted in Mandrake 10.0 when inserted and icon appers on the desktop.

Question:
Does it also get autoUNmounted when removed or do i need to do that manually?

Regards Klas
 
Old 01-22-2005, 10:20 AM   #2
pongmaster
Member
 
Registered: Jul 2004
Location: London, England
Distribution: Mandrake 10.1
Posts: 300

Rep: Reputation: 30
It should unmount automatically when it's removed from your machine.

It should automount under /mnt/removable (mine does - Kingston brand too) and you can check this directory to see if it's still mounted when removed.
 
Old 01-22-2005, 10:47 AM   #3
Klas
Member
 
Registered: Oct 2003
Location: Uppsala, Sweden
Distribution: Mandrake 9.1, Mandrake 10.0
Posts: 77

Original Poster
Rep: Reputation: 15
How can i be sure that "all" info that i written to the device is really written, and that there is no caching by the system involved?

I mean, i also have a MuVo2 MP3 player which i mount manually with the command:
Code:
mount -t vfat /dev/sda /mountDestination
it seems like the system cache a lot of information while i move files to the mp3 player and writes it to the player after i issue the umount command.

Is there a way to stop the system from caching and write the information immedialey to the device? And is it that that actually goes on when the system supermounts a USB memory, and makes it possible to just remove the device?

Regards
Klas
 
Old 01-22-2005, 05:44 PM   #4
Klas
Member
 
Registered: Oct 2003
Location: Uppsala, Sweden
Distribution: Mandrake 9.1, Mandrake 10.0
Posts: 77

Original Poster
Rep: Reputation: 15
Bump
 
Old 01-24-2005, 04:29 AM   #5
bunnadik
Member
 
Registered: Jan 2005
Location: Övik, Sweden
Distribution: MDK 10.1
Posts: 450

Rep: Reputation: 30
If you check /etc/fstab the "/mnt/removable" entry should contain a "sync" line indicating that all I/O is synchronous, meaning
it's written directly and not cached.

The only thing I'm not sure of is that if you look at 'man mount' there is no "sync" option to vfat.

To be really sure it's always best to unmount before removing. That goes for Windows as well (look at the "Secure removal of hardware" icon in your systray).

- Peder
 
Old 01-24-2005, 12:24 PM   #6
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
When you plug in your USB stick, and Mandrake detects it, type this in your console:

Code:
df
It will show a list of the mount points and your USB stick should be something like /mnt/removable or /mnt/usbstick. If that is on there, then you know for sure that data is being written on the USB stick. And when you pull out the USB stick and type 'df' again, the /mnt/removable or /mnt/usbstick should disappear.
 
Old 01-24-2005, 12:41 PM   #7
Klas
Member
 
Registered: Oct 2003
Location: Uppsala, Sweden
Distribution: Mandrake 9.1, Mandrake 10.0
Posts: 77

Original Poster
Rep: Reputation: 15
Hi
This is starting to get interesting. As you mentioned Peder, mount doesnt have a sync option. This is the line that appers in fstab when a memory stick is automounted in Mandrake 10.0 (no sync parameter):
Code:
none /mnt/removable supermount dev=/dev/scsi/host0/bus0/target0/lun0/part1,fs=ext2:vfat,--,umask=0,iocharset=iso8859-1,kudzu,codepage=850 0 0
Then its not only "best" to unmount it first, it should be mandatory.
I think its a bit dangerous of Mandrake to mount the device automaticly with a icon and all on the desktop, and the "force" the user to the shell if he/she wants to unmount it correctly (umount /mnt/removable). Its really easy to belive that Mandrake take care of the mount/umount process for you.

Micro420, even if the device is mounted there is no guarantee that the data is actually written to the device at the same time as you perform a copy or whatever. The system may cache it and write it to the device at a more "appropriate" time. You can "force" the system to write the data to the device by issueing the umount command.

Or mayby its not that big of a deal? I dont think that that many windows users uses the "secure removal" option in the tray even if its avalible and it seems to work fine?

Klas
 
Old 01-24-2005, 01:23 PM   #8
Micro420
Senior Member
 
Registered: Aug 2003
Location: Berkeley, CA
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986

Rep: Reputation: 45
Quote:
Originally posted by Klas
Micro420, even if the device is mounted there is no guarantee that the data is actually written to the device at the same time as you perform a copy or whatever. The system may cache it and write it to the device at a more "appropriate" time. You can "force" the system to write the data to the device by issueing the umount command.

Or mayby its not that big of a deal? I dont think that that many windows users uses the "secure removal" option in the tray even if its avalible and it seems to work fine?

Klas [/B]
I don't know what you mean by delaying the write, but everytime I use my mount stick and copy data, it does it on the spot and I can pull the stick out and switch it on a different machine with the data there. I do this now and then for work.
 
Old 01-24-2005, 01:46 PM   #9
Klas
Member
 
Registered: Oct 2003
Location: Uppsala, Sweden
Distribution: Mandrake 9.1, Mandrake 10.0
Posts: 77

Original Poster
Rep: Reputation: 15
OK ill explain my MuVo2 example a bit better.

I also have my MuVo2 MP3 player with a 4Gb small harddrive.
When i want to copy some music to this device i normaly mount the device from the shell, and then fire up konquror to have a GUI to work in.
When i copy music to the device in konqueror, a progress bar shows up showing the remaining time etc. After a while the progress bar disapear, making you belive that every file is on the device. That the transfer is complete. But thats not true, if i should remove the device at this point i probably would miss data on the device or even crash it.

Then is really important to make a correct umount BEFORE you remove the device. An umount of my mp3 player sometimes takes a couple of minuts, meanwhile i see a heavy transfer activity. It actually writes some of the information to disk at the point when i umount it. The system have cached the data uptil then.

Do you now understand what i mean? Atleast i think this is whats going on

Klas
 
Old 01-25-2005, 03:21 AM   #10
bunnadik
Member
 
Registered: Jan 2005
Location: Övik, Sweden
Distribution: MDK 10.1
Posts: 450

Rep: Reputation: 30
In 10.1 they've added a sync entry to fstab:
/dev/sdc1 /mnt/removable auto umask=0,user,iocharset=iso8859-1,sync,kudzu,codepage=850,noauto,exec,users 0 0
And 'mount -t vfat /dev/usbstick1 /USB/ -o sync' is accepted so obviosly there is a sync option to vfat (just wrongly [un]documented).

But I think the point is that if you use an USB stick you shouldn't remove it before unmounting (after all I think that's why Windows
has that option). If you don't unmount it'll probably work just fine, but if it breaks you get to keep both pieces

And I think you can right-click on the desktop icon and choose to unmount it. (Just guessing, I dont' use KDE or Gnome).

- Peder
 
Old 01-25-2005, 02:48 PM   #11
Klas
Member
 
Registered: Oct 2003
Location: Uppsala, Sweden
Distribution: Mandrake 9.1, Mandrake 10.0
Posts: 77

Original Poster
Rep: Reputation: 15
Hi
Were could i change the entry that pops up in fstab when a memory stick is inserted, to include the sync option?
The fstab file seem to be changed "dynamicly" when a device is connected.

The icon on the desktop only shows that a device is connected, not if its mounted or not. But i know what you mean, i have seen that type of icon in another senario.

Klas
 
Old 01-26-2005, 02:32 AM   #12
bunnadik
Member
 
Registered: Jan 2005
Location: Övik, Sweden
Distribution: MDK 10.1
Posts: 450

Rep: Reputation: 30
Try ' echo "SYNC=yes" >> /etc/sysconfig/dynamic' . That might only apply to 10.1
( http://cvs.mandrakesoft.com/cgi-bin/...akupdate_fstab )

Otherwise looke at /etc/dynamic/scripts/part.script and /usr/sbin/drakupdate_fstab. That's where the magic happens.

- Peder
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing memory in USB stick, flash memory, removable hd etc bamboo_spider Linux - Newbie 3 06-14-2006 06:39 PM
Using memory stick MalachiX Linux - Newbie 1 04-13-2005 01:13 AM
memory stick rosslaird Debian 5 07-23-2004 09:01 PM
Memory Stick on Sony kkempter Linux - Laptop and Netbook 1 07-12-2003 05:51 PM
memory stick / CF memory card reader X-dazed Linux - Newbie 1 01-21-2003 01:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 07:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration