USB Pen Drive - Enabling unmounting and other issues
su > umount /dev/hdb. But I would like to allow myself as a user to unmount it too. I think I need to do some /etc/fstab editing here, so
Hello. I have a Transcend JetFlash 256 MB pen drive. Whenever I plug it into my PC, Linux autodetects and automounts it. But as an ordinary user I do not have permission to unmount it, which is required procedure before pulling it out from the machine. Of course, I can goto konsole please give me instructions. Is it also possible for me to give this some permanent location at /media/usbpendrive just like /media/dvdram and /media/cdrom which I already have? Should I specify that at One problem is that, IIRC, the /dev/hd? position of the USB drive depends on what is already mounted. If one of my optical drives is mounted, then that drive will be /dev/hda and my USB drive will be /dev/hdb. If two of my optical drives are mounted, then the USB drive is /dev/hdc. So how do I give the USB drive a consistent reference in fstab? (I have to check this hda-hdb phenomenon again, but I remember it was this way - I'm now writing from Windoze. But the gurus here should know the theory.) While I'm at it: is it possible for an optical drive without any media in it to be mounted, or is mounting only for something that contains a filesystem and not for a pure device?
Samjnaa Tattvavaadin wrote:
Hello.
su > umount /dev/hdb. But I would like to allow myself as a user to unmount it too. I think I need to do some /etc/fstab editing here, so
I have a Transcend JetFlash 256 MB pen drive. Whenever I plug it into my PC, Linux autodetects and automounts it. But as an ordinary user I do not have permission to unmount it, which is required procedure before pulling it out from the machine. Of course, I can goto konsole please give me instructions.
As far as I know, USB drives don't have to be unmounted, as the data is written immediately. This means that it's safe to unplug, when the light stops flashing.
On 8/19/05, James Knott <james.knott@rogers.com> wrote:
Samjnaa Tattvavaadin wrote:
Well Shriramana Sharma uses this alias of Samjnaa Tattvavaadin in Google Accounts and forgot to change the mail settings to say Shriramana Sharma in the from field. Apologies. [I am Shriramana Sharma and I am Samjnaa Tattvavaadin. Anybody interested in understanding the meaning of these words can mail me offlist. ;)]
As far as I know, USB drives don't have to be unmounted, as the data is written immediately. This means that it's safe to unplug, when the light stops flashing.
Then why does Win 2K and Win XP have a feature: "unplug this USB device" (or something similar)? IIRC someone on nntp://novell.support.suse.linux.professional told me that the data needs to be flushed to the drive.
Shriramana Sharma wrote:
Then why does Win 2K and Win XP have a feature: "unplug this USB device" (or something similar)?
Yes quite. I'm also interested in this subject because it's something I have never quite understood. If I'm in a hurry I usually just umount the filesystem of my iAudio MP3 player as you were describing in an earlier post and unplug the device. However, the display (on my iAudio) still says something about "DO NOT UNPLUG" which sounds quite serious in capitals so if I can be bothered I shut the system down before unplugging. So, a) What happens when you "safely remove" the device in windows? and b) How do you do it on SuSE? Yours confusedly, James Watkins.
James Watkins wrote:
Shriramana Sharma wrote:
Then why does Win 2K and Win XP have a feature: "unplug this USB device" (or something similar)?
Yes quite. I'm also interested in this subject because it's something I have never quite understood. If I'm in a hurry I usually just umount the filesystem of my iAudio MP3 player as you were describing in an earlier post and unplug the device. However, the display (on my iAudio) still says something about "DO NOT UNPLUG" which sounds quite serious in capitals so if I can be bothered I shut the system down before unplugging. So, a) What happens when you "safely remove" the device in windows?
You flush the cache.
and
b) How do you do it on SuSE?
Here's what it says in the 9.3 Admin guide. "13.2. Mobile Hardware SUSE LINUX supports the automatic detection of mobile storage devices over firewire (IEEE 1394) or USB. The term mobile storage device applies to any kind of firewire or USB hard disk, USB flash drive, or digital camera. These devices are automatically detected and configured via hotplug as soon as they are connected with the system over the corresponding interface. subfs and submount ensure that the devices are mounted to the corresponding locations in the file system. The user is completely spared the manual mounting and unmounting that was found in previous versions of SUSE LINUX. A device can simply be disconnected as soon as no program accesses it."
Dear Guy with Two Full Sets of Names, On Friday 19 August 2005 01:04, Shriramana Sharma wrote:
On 8/19/05, James Knott <james.knott@rogers.com> wrote:
Samjnaa Tattvavaadin wrote:
...
As far as I know, USB drives don't have to be unmounted, as the data is written immediately. This means that it's safe to unplug, when the light stops flashing.
I considered responding to this, but it's getting harder and harder to keep up with all the misinformation and imprecision floating by, here. For the default configuration of recent SuSE Linux distributions, USB devices are auto-mounted with the option that prevents the kernel from retaining unwritten data blocks (the "sync" option in /etc/fstab or in the output from the "mount" command). This means that unless you disconnect such a device while a program is actively writing to it, the contents will be consistent and up-to-date. This is not, however, an intrinsic property of these devices, as the preceding paragraph seems to suggest.
Then why does Win 2K and Win XP have a feature: "unplug this USB device" (or something similar)? IIRC someone on nntp://novell.support.suse.linux.professional told me that the data needs to be flushed to the drive.
Windows does not do the equivalent of what I describe above, hence you must request that it put the data structures on the device into a state that allows the device to be removed without risk of file system or file data corruption or loss. Randall Schulz
On 8/19/05, Randall R Schulz <rschulz@sonic.net> wrote:
Dear Guy with Two Full Sets of Names,
:) S.T. is only an alias. S.S. is my proper name.
the output from the "mount" command). This means that unless you disconnect such a device while a program is actively writing to it, the contents will be consistent and up-to-date.
Hmm. I got an idea - why can't USB ports be designed with a mechanical "gripper" that physically restrains the device from being unplugged unless the OS permits it? (Of course, there must be a physical override as well...)
Windows does not do the equivalent of what I describe above, hence you must request that it put the data structures on the device into a state that allows the device to be removed without risk of file system or file data corruption or loss.
But then is the absence of this "unplug this device safely" feature in Windows 98 a suggestion that Win 98 actually handles the matter like Linux?
On Friday 19 August 2005 09:57, Shriramana Sharma wrote:
But then is the absence of this "unplug this device safely" feature in Windows 98 a suggestion that Win 98 actually handles the matter like Linux?
No. To use a USB thumbdrive -- or any removable device -- in Win9x you have to install a driver specific to that device. If you've used a thumbdrive in Win9x than I'm sure you recall loading a device driver. -- Christopher Shanahan
On 8/19/05, Christopher Shanahan <cshanahan@comcast.net> wrote:
On Friday 19 August 2005 09:57, Shriramana Sharma wrote:
But then is the absence of this "unplug this device safely" feature in Windows 98 a suggestion that Win 98 actually handles the matter like Linux?
No. To use a USB thumbdrive -- or any removable device -- in Win9x you have to install a driver specific to that device. If you've used a thumbdrive in Win9x than I'm sure you recall loading a device driver.
Yes of course, but the point I was making was that I did not need to unmount (aka flushing write data to) the USB device in Windows, and was allowed to remove it once there's no program writing to it. Of course, I've also been told that under Win 2K or XP too I can do the same. I usually take the safe way out - humour Windows and use the "unplug safely" function. But my q still stands. How come Win 98 doesn't give me a tray app for unmounting the USB device? Of course, such a complaint is better on a Windows list, but still, if Win 98 could do it, Win 2K or Win XP could too, just tell the user that the device can be pulled out when there's no write operation. Similar situation exists (pulling out when no writing going on) in Linux, but I noticed that there are a couple of programs installed which do this - isn't KwikDisk for this?
Shriramana Sharma wrote:
Yes of course, but the point I was making was that I did not need to unmount (aka flushing write data to) the USB device in Windows, and was allowed to remove it once there's no program writing to it. Of course, I've also been told that under Win 2K or XP too I can do the same. I usually take the safe way out - humour Windows and use the "unplug safely" function.
But my q still stands. How come Win 98 doesn't give me a tray app for unmounting the USB device? Of course, such a complaint is better on a Windows list, but still, if Win 98 could do it, Win 2K or Win XP could too, just tell the user that the device can be pulled out when there's no write operation.
I don't recall the details in W98, but if it allowed you to simply unplug the USB drive, then they weren't caching the data. In XP and W2000, you are supposed to click on that button, to make it safe to remove. This implies that the data is cached and by clicking, you're flushing the cache. If you only read, you don't have to worry about this, on any OS.
On Friday 19 August 2005 13:17, Shriramana Sharma wrote:
Yes of course, but the point I was making was that I did not need to unmount (aka flushing write data to) the USB device in Windows, and was allowed to remove it once there's no program writing to it.
That's because the device driver provided by the manufacturer took care of the writing (sync), as opposed to the OS. In Win2k and later writing to a USB device was made a part of the OS. In other words, MS provided generic, all purpose device drivers that controlled their functionality.
Of course, I've also been told that under Win 2K or XP too I can do the same. I usually take the safe way out - humour Windows and use the "unplug safely" function.
Failing to 'eject' the USB device properly may not _always_ cause you issues; however, I can tell you -- speaking from experience -- that at some time you will have problems if you simply remove the device. Especially when you take into account the file system associated with your USB device -- most are FATx. The FATx file system is _very_ unforgiving when it coming to writing (sync) data to it. Truth is, nothing prevents you from removing the USB device from your machine, whether the OS is using it or not.
But my q still stands. How come Win 98 doesn't give me a tray app for unmounting the USB device? Of course, such a complaint is better on a Windows list, but still, if Win 98 could do it, Win 2K or Win XP could too, just tell the user that the device can be pulled out when there's no write operation.
Because that functionality was not made a part of the OS until Win2k came along. In earlier versions of Windows, such as Win9x, that functionality was provided by third party device drivers, not the OS. -- Christopher Shanahan
Christopher, that was very clear, thanks. But my question still remains: how do I edit my /etc/fstab to allow unmounting by the user of the USB drive?
Incomplete text from my first post on this thread: Is it also possible for me to give this some permanent location at /media/usbpendrive just like /media/dvdram and /media/cdrom which I already have? Should I specify that at ... /etc/fstab too? Thanks, all. On 8/19/05, Shriramana Sharma <samjnaa@gmail.com> wrote:
Christopher, that was very clear, thanks.
But my question still remains: how do I edit my /etc/fstab to allow unmounting by the user of the USB drive?
Shriramana Sharma wrote:
Incomplete text from my first post on this thread:
Is it also possible for me to give this some permanent location at /media/usbpendrive just like /media/dvdram and /media/cdrom which I already have? Should I specify that at ... /etc/fstab too?
Give it a volume name. Then when you plug it in, it'll have a mount point of /media/volume_name. One nice thing about this, is that different drives can have different mount points.
Shriramana Sharma wrote:
On 8/19/05, James Knott <james.knott@rogers.com> wrote:
Samjnaa Tattvavaadin wrote:
Well Shriramana Sharma uses this alias of Samjnaa Tattvavaadin in Google Accounts and forgot to change the mail settings to say Shriramana Sharma in the from field. Apologies. [I am Shriramana Sharma and I am Samjnaa Tattvavaadin. Anybody interested in understanding the meaning of these words can mail me offlist. ;)]
As far as I know, USB drives don't have to be unmounted, as the data is written immediately. This means that it's safe to unplug, when the light stops flashing.
Then why does Win 2K and Win XP have a feature: "unplug this USB device" (or something similar)? IIRC someone on nntp://novell.support.suse.linux.professional told me that the data needs to be flushed to the drive.
I thought we were talking about Linux. If the data is written immediatelty, there is no need to flush the cache, as the cache isn't used for writing. As I recall, this is a fairly recent development, as earlier versions of SuSE did require unmounting USB devices. Compare with floppies. You've never had to unmount floppies in DOS or Windows, as the data was written immediately. However, in Linux you had to, as the data was cached, before writing to the floppy.
On Friday 19 August 2005 04:04, Shriramana Sharma wrote:
Then why does Win 2K and Win XP have a feature: "unplug this USB device" (or something similar)? IIRC someone on nntp://novell.support.suse.linux.professional told me that the data needs to be flushed to the drive.
With earlier Linux versions it was important to umount the USB thumb drive before unplugging. Sometimes there would be some data not yet written that would be written at that time. My understanding is that recent Linux versions automount it in "snyc" mode, meaning the data is written immediately and therefore you can unplug it when the activity light goes out. Bryan ******************************************************** Powered by SuSE Linux 9.2 Professional KDE 3.3.0 KMail 1.7.1 This is a Microsoft-free computer Bryan S. Tyson bryantyson@earthlink.net ********************************************************
participants (7)
-
Bryan Tyson
-
Christopher Shanahan
-
James Knott
-
James Watkins
-
Randall R Schulz
-
Samjnaa Tattvavaadin
-
Shriramana Sharma