[Courses] mounting floppy
Devdas Bhagat
devdas at dvb.homelinux.org
Thu Aug 5 00:40:21 EST 2004
On 04/08/04 11:57 -0700, Mag Mu wrote:
> Hello!
>
> After mounting my floppy, I wrote a test file. Now I
> cannot umount /mymount/ even after removing the file.
> Also, nothing was actually written to the physical
> disk.
Wrong list. Please post to newchix, or techtalk.
I am not CC'ing either list, because I don't see a long discussion on
this coming up.
>
> So, 2 questions:
> 1. When is data actually written to the physical
> disk?
When you use a removable slow medium like a floppy disk, Linux buffers
the write until you unmount the medium, or until you call sync.
> 2. How do I unmount the floppy?
<snip>
Transcript left for comparison.
> Here is a transcript of what I did:
> [root at localhost mymount]# mount -t vfat /dev/fd0
> /mymount/
>
> [root at localhost mymount]# vi test
>
> [root at localhost mymount]# ls
> test
>
> [root at localhost mymount]# umount /mymount/
> umount: /mymount: device is busy
>
> [root at localhost mymount]# rm test
> rm: remove regular file `test'? y
>
> [root at localhost mymount]# ls -l
> total 0
>
> [root at localhost mymount]# umount /mymount
> umount: /mymount: device is busy
>
> [root at localhost mymount]# ls -l
> total 0
>
I don't have a floppy disk drive here, so I can't do a real transcript,
but here is an attempt anyway. The // marks a comment, # is for a root
prompt, and $ is for my regular user prompt.
# With /mnt/floppy in /etc/fstab, I could just use
# mount -t vfat /mnt/floppy
# I can also ignore specifying the fstype explicitly and let Linux do
# the guesswork
# mount /mnt/floppy works quite well
[devdas at evita devdas]$ mount -t vfat /dev/fd0 /mnt/floppy
# At this point I am accessing the floppy.
[devdas at evita devdas]$ cd /mnt/floppy
# List files on the floppy
[devdas at evita floppy]$ ls
# Create a file
[devdas at evita floppy]$ touch file
# List again
[devdas at evita floppy]$ ls
file
# Move out prior to unmounting the disk
# While I am in the /mnt/floppy directory, there are open filehandles and
# that causes trouble with the unmout call.
[devdas at evita floppy]$ cd ..
# This unmounts the floppy and forces data to be written to disk.
[devdas at evita mnt]$ umount floppy
[devdas at evita mnt]$
I hope this helps.
Devdas Bhagat
More information about the Courses
mailing list