<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/1.1.8">
</HEAD>
<BODY>
&quot;df&quot; will show you what is mounted. &quot;df -lh&quot; 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. <BR>
On Sun, 2003-09-21 at 17:42, Asheville Joe wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373" SIZE="3"><I>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
----------------------------------
&quot;I can assure you the flying saucers, given that they exist, are not
constructed by any power on earth.&quot; --Harry S. Truman; White House Press
Conference, Washington DC, April 4, 1950.

</I></FONT></PRE>
</BLOCKQUOTE>
<PRE><TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Cyber Source &lt;<A HREF="mailto:peter@thecybersource.com">peter@thecybersource.com</A>&gt;
</TD>
</TR>
</TABLE>
</PRE>
</BODY>
</HTML>