mount and umount

John Seth johnseth at phoenixwing.com
Mon Sep 22 07:21:27 EDT 2003


if you use 'mount /dev/hdb1 /mnt/portable' and type 'umount /dev/hdb1'
or 'umount /mnt/portable', the device will unmount regardless, as long
as either the mount point, or device is specified.

The directory will be writable either way, unless a device is mounted
read-only, or the permissions on the directory prevent writing by that
user/group.

Try this: with the device unmounted, type: 'touch
/mnt/portable/testfile'.  Mount the device to that directory. 
'testfile' should now be missing since it is not on that device.

-- 
<? print(pack("c*", 74,117,115,116,32,/* Tony Evans                  */
 65,110,111,116,104,101,114,32,80,72, /* Linux/Web Implementation    */
 80,32,72,97,99,107,101,114,46,10));  /* http://www.phoenixwing.com/ */ ?>


> "df" will show you what is mounted. "df -lh" will give more info in
> summary. My guess would be you were not unmounted because you unmounted
> /dev/hdb1 and not /mnt/portable. Remember too that you cannot be in the
> dir when trying to unmount it either.
> On Sun, 2003-09-21 at 17:42, Asheville Joe 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
>> /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
>> /dev/hda5 /mnt/dos_hda5 vfat
>> iocharset=iso8859-1,codepage=850,umask=0,defaults  0
>> none /mnt/floppy supermount
>> dev=/dev/fd0,fs=auto,--,iocharset=iso8859-1,sync,codepage=850,umask=0
>>  0
>> /dev/hdb1 /mnt/portable ext3 rw,user,noauto,exec,suid  0
>> none /proc proc defaults  0
>> /dev/hda8 swap swap defaults  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.
>>
>>
>
> --
> Cyber Source <peter at thecybersource.com>
>




More information about the nflug mailing list