LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-01-2007, 08:35 PM   #16
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492

Quote:
Originally Posted by Sepero
BTW: My explaination makes Unmounting pretty useless for Read-Only devices, and it actually quite is.
I hope you realize your whole theory is quite broken, including that last statement.
 
Old 02-01-2007, 08:42 PM   #17
Sepero
Member
 
Registered: Jul 2004
Location: Tampa, Florida, USA
Distribution: Ubuntu
Posts: 734
Blog Entries: 1

Rep: Reputation: 33
Quote:
Originally Posted by jlliagre
Linux flushes the file cache regularily (i.e. seconds), otherwise, you would loose all your new data after a power failure.
Sorry if I made it seem otherwise. Of course the files are syncronized every few seconds (usually about 5).

And yes, fragmentation is related to the filesystem. NTFS is less fragmented than FAT32 (but still more than any common Linux fs. WinFS was supposed to be the FS to end defraging for MS, but it never made the deadline.)
 
Old 02-01-2007, 08:46 PM   #18
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by Sepero
This is pretty much the conclusion that I have come to also. Not just for USB, but all writable filesystems.

The order goes like this:
1. mount
2. write files, erase files, modify files
3. u(n)mount

The benefit is in the Unmount. Because the Unmount is when files are actually written (syncronized) and finalized on the drive.

This allows Linux to:
1. Keep files from becoming fragmented.
2. Reduce wasted writes to the drive. (Which is beneficial for any device, but especially flash devices.)

Microsoft tends to write files with less care, which is why their Operating Systems continuously need defragmenting.
Uhhhh....

No.

When you mount a filesystem, you are telling the OS where it is, what it is, and how to access it. While it is mounted (presuming it can be written), writes will be committed to it at frequent intervals - at most after a few seconds ordinarily.

When you unmount a filesystem, you are telling the OS that it is no longer there and can't be used.

All filesystems have to be mounted by all operating systems (except custom-written embedded ones) before they can be accessed. Commonly the system hard drive partition will be mounted automatically very early in the boot process, but other drives/partitions/devices can be mounted or unmounted manually and pretty much at will - even in Windows.
 
Old 02-01-2007, 09:05 PM   #19
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by Sepero
Sorry if I made it seem otherwise. Of course the files are syncronized every few seconds (usually about 5).
You indeed made it seem otherwise by this statement:
Quote:
Originally Posted by Sepero
This allows Linux to:
1. Keep files from becoming fragmented.
2. Reduce wasted writes to the drive. (Which is beneficial for any device, but especially flash devices.)
As you agree now the cache is flushed regularily, I believe they both make little sense.

Quote:
And yes, fragmentation is related to the filesystem. NTFS is less fragmented than FAT32 (but still more than any common Linux fs. WinFS was supposed to be the FS to end defraging for MS, but it never made the deadline.)
No, WinFS is/was not a real filesystem but a different way to access existing files, available on an existing file system (NTFS), so it has no effect whatsoever on fragmentation.
 
Old 02-02-2007, 01:16 AM   #20
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
I think the reason mounting is not visible in Windows is that it is all done automatically. A:\ is the mount point for the first floppy drive, and it expects a 3.5" VFAT filysystem. C:\ is the mount point for the first active primary partition on the primary IDE hard drive. Other disk letters in Windows are likewise - but it is all done automatically.

You could take the C:\ drive from one computer, and put it in another one and it will be mounted accordingly.

Also, USB drives in Windows need to be Unmounted Manually - you have to click "Stop the device" or whatever on the taskbar. Presumably, all the drives in Windows are unmounted cleanly when the computer is shutdown.

As already stated, mounting tells the OS what the filesystem is, where it is, where it is to be accessed from, etc.

--Ian
 
Old 02-02-2007, 01:49 AM   #21
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
To not get this kind of message like in MS-DOS:
http://en.wikipedia.org/wiki/Abort,_Retry,_Fail%3F

MS-DOS was unable to know if the floppy drive was closed.
I'm sure some of you remember these messages
 
Old 02-02-2007, 04:48 AM   #22
The Godfather
Member
 
Registered: Jul 2005
Location: England
Distribution: 2.6.15-1.2054_FC5
Posts: 35

Rep: Reputation: 15
Quote:
Originally Posted by jlliagre
Hopefully not.
If so, that would have been a serious bug.
Linux, like all Unixes, do flush the file cache regularily (i.e. seconds), otherwise, you would loose all your new data after a power failure.
If you are correct, then what is the point of 'sync' and 'async' used in /etc/fstab?

I thought 'sync' was there to allow you to physically write changes to the mounted device when you issue the command.

And 'async' just writes the changes when you unmout the device.

I don't know the directory of the intermediate store.

Obviously a server would be 'sync' or at least data would be stored every-so-often.

I do believe that if you have 'async' on, and you simply disconnect the mounted device without unmouting, all data will be lost.
 
Old 02-02-2007, 05:19 AM   #23
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by The Godfather
If you are correct, then what is the point of 'sync' and 'async' used in /etc/fstab?
To bypass the cache all together (sync), or use the default behaviour (async).
Quote:
I thought 'sync' was there to allow you to physically write changes to the mounted device when you issue the command.
On the opposite, the sync option remove the sync command purpose for that filesystem.
Quote:
And 'async' just writes the changes when you unmout the device.
No, it writes the changes asynchronously, i.e later.
Quote:
I don't know the directory of the intermediate store.
What do you mean ? There is no such directory, the intermediate store is in memory, and later in the journal for journaling filesystems.
Quote:
Obviously a server would be 'sync' or at least data would be stored every-so-often.

I do believe that if you have 'async' on, and you simply disconnect the mounted device without unmouting, all data will be lost.
That is hopefully not the case, just try by yourself if you still doubt about it.

Last edited by jlliagre; 02-02-2007 at 05:22 AM.
 
Old 02-02-2007, 05:26 AM   #24
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by jlliagre
That is hopefully not the case, just try by yourself if you still doubt about it.
I highly doubt it. You can easily loose file or even worse, put the filesystem in a state where its not accessible anymore. But I won't try it

I've seen it on XP, the usb stick had to be reformated.

Last edited by nx5000; 02-02-2007 at 05:28 AM.
 
Old 02-02-2007, 10:53 AM   #25
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
Windows actually uses the bios to know what devices are present in the system to mount them. This is why if you remove a floppy drive and remove it from the bios windows will not make a A: drive in my computer. It does this for almost all disks with the exception of usb media or other external drives. removable media such as cd-roms and floppys have a diffrent access driver then does the hard drives in the system. when you put a disk in what happens behind the scens is much like linux. When you put a cdrom in the drive checks for a disk and if it finds one it sends a data packet to the bios telling it that a disk has been inserted this in turn is captured by the os thus it tries known file systems with an attempt to mount. basicly a mount --auto <cdrom drive>. and then the operating system checks for a file called autorun and executes any commands that are written on this file. Floppies are a bit diffrent as the technology for them is more outdated. the operating system assumes there is a disk in the drive at all times and attempts to just read data from it when asked to. AKA the dredad abort retry fail message. Windows XP might handle this a bit diffrently by attempting a mount operation first but im not sure. As for flash drives windows just monitors the usb device for a power event and when it recivies one it attempts to reconize the device and if it comes back with a code it understands it will attempt to mount the device with known file systems. you can setup linux to do the same things with the exception of floppies as linux will put a drive there regardless of bios calls. (again this differs with difrent device handling with various distributions. I belive my udev does not create the /dev/fda devices
 
Old 02-02-2007, 11:42 AM   #26
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by nx5000
I highly doubt it. You can easily loose file or even worse, put the filesystem in a state where its not accessible anymore. But I won't try it

I've seen it on XP, the usb stick had to be reformated.
We were talking about Linux (or more generally Unix) mounting/unmounting behaviour, not XP which may have its own flaws here.

However, I know what you mean, and indeed loosing a file or the whole filesytem may (but not will always) happen. This is more due to the FAT unreliability that anything else, and will happen only if you don't wait enough for the cache to be flushed.
 
Old 02-02-2007, 12:17 PM   #27
mamtasahai1
Member
 
Registered: Jan 2007
Location: India
Distribution: RHEL 5, Fedora 9, Solaris, FreeBSD
Posts: 52

Original Poster
Rep: Reputation: 15
I am very much thankful to all and I learn much more through the forum.
 
Old 02-02-2007, 02:44 PM   #28
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Thank you for saying "thank you".
We should offer a prize for Newbie follow-thru.....
 
Old 03-12-2007, 12:44 PM   #29
gymnart
Member
 
Registered: Oct 2005
Distribution: SUSE 11.4
Posts: 331

Rep: Reputation: 30
I have a quick question:
Do you have to unmount a usb flash drive before you pull it out?
I have SuSE 10.0 and when I put the usb flash drive in, it knows that it is there and reads it. But I want to be sure that I am not ruining anything when I just take the flash drive out without issuing any unmount commands.

I've never been able to get the umount command straight when I tried it either. (I've tried it for a special network folder for Open Office).
 
Old 03-12-2007, 01:20 PM   #30
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
yes you definitely need to (unless you're using automount etc...) as the sytem will still think it's there, and try to access it if you go to that directory, which it can't and things go bad.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting digital camera, mounting in general? lugoteehalt Linux - Hardware 6 08-29-2006 12:52 PM
Mounting an ISO image from a CD different than mounting from HD? NoTiG Linux - Software 4 08-03-2005 04:40 PM
Gnome 2.6 Right click mounting and the mounting system Acetylcholine Linux - Hardware 0 07-25-2004 07:34 AM
Mounting HDD vs. Mounting Filesystem snailophone Linux - Hardware 4 08-12-2003 11:00 AM
Mounting mounting extended partition and its Logical drives desbyleo Linux - Newbie 10 02-18-2002 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:17 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