mount and umount

Asheville Joe josephj at main.nc.us
Mon Sep 22 21:49:05 EDT 2003


Now that I understand it, I'll remember it ;)!

Joe

Robert Meyer wrote:

>When you unmount a device, the underlying directory becomes available again. 
>Remember that you mount a filesystem on an existing directory.
>
>Cheers!
>
>Bob
>--- Asheville Joe <josephj at main.nc.us> wrote:
>  
>
>>I have a removeable ide hard disk as hdb1.  I want to write a script to
>>access it for backup (a copy of my fstab is included below.  I wanted to 
>>test if it was mounted, and, if not, mount it.  To try it out, I went 
>>into an Xterm.
>>I su'd and mounted it -
>>mount /dev/hdb1 /mount/portable.  I  did a cd /mnt/portable and wrote a
>>small junk file to it and that worked.  So far so good.  Then, I did a
>>cd .. and umount /dev/hdb1.
>>I tried that again and it told it was not mounted (as expected).  BUT, I
>>then did an ls /mnt/portable and it still worked!  I even copied another
>>small junk file to it (although I had to su for it to work, which I 
>>don't understand).
>>
>>I thought that when I unmounted the device, trying to access, let alone
>>write to /mnt/portable would fail and generate an error.  It didn't!
>>
>>What don't I understand (about this in particular :) )?
>>
>>How do you test to see if a device is mounted (or accessible?) ?
>>
>>Joe
>>
>>/etc/fstab:
>>
>>/dev/hda7 / ext3 defaults 1 1
>>/dev/hda6 /boot ext2 defaults 1 2
>>none /dev/pts devpts mode=0620 0 0
>>/dev/hda9 /home ext3 defaults 1 2
>>none /mnt/cdrom supermount
>>dev=/dev/scd0,fs=auto,ro,--,iocharset=iso8859-1,codepage=850,umask=0 0 0
>>/dev/hda1 /mnt/dos_hda1 vfat
>>iocharset=iso8859-1,codepage=850,umask=0,defaults 0 0
>>/dev/hda5 /mnt/dos_hda5 vfat
>>iocharset=iso8859-1,codepage=850,umask=0,defaults 0 0
>>none /mnt/floppy supermount
>>dev=/dev/fd0,fs=auto,--,iocharset=iso8859-1,sync,codepage=850,umask=0 0 0
>>/dev/hdb1 /mnt/portable ext3 rw,user,noauto,exec,suid 0 0
>>none /proc proc defaults 0 0
>>/dev/hda8 swap swap defaults 0 0
>>----------------------------------
>>"I can assure you the flying saucers, given that they exist, are not
>>constructed by any power on earth." --Harry S. Truman; White House Press
>>Conference, Washington DC, April 4, 1950.
>>
>>
>>
>>
>>
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! SiteBuilder - Free, easy-to-use web site design software
>http://sitebuilder.yahoo.com
>
>  
>

-- 

----------------------------------
"Insanity in individuals is something rare - but in groups, parties, nations and epochs, it is the rule." --Friedrich Nietzsche





More information about the nflug mailing list