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 |
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. |
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 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 |
Bump
|
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 |
When you plug in your USB stick, and Mandrake detects it, type this in your console:
Code:
df |
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 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 |
Quote:
|
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 |
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 |
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 |
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 |
All times are GMT -5. The time now is 04:27 PM. |