RE: mount/umount causes panic

"Oliver Pitzeier" <[email protected]> Mon, 13 Jan 2003 09:35:23 +0100
Newsgroups gmane.linux.redhat.axp.kernel
Organization UPtime system solutions
Message-ID <[email protected]>
Brian Sullivan:
> [ ... ] When I run the script however the 
> kernel panics after 30 to 50 ISOs (never crashes on the same 
> ISO twice, seems random). The kernel panic is hollering about 
> "Attempted to kill init".
[ ... ]

Well, I'm not really sure why this problem could happen, but I believe it's not
AXP-kernel specific...

However... I guess moving the ISO back and forward on your harddisk may be the
problem...

> SLOTLIST=`ls slot*`
> for SLOT in $SLOTLIST
> do
>     echo "Moving $SLOT to reader..."
>     mv $SLOT reader01
> 
>     echo "Mounting..."
>     mount reader01
> 
>     ls /mnt/cdsim1/D*
>     #sleep 50
> 
>     echo "Un-Mounting..."
>     umount -d reader01
> 
>     echo "Moving $SLOT back..."
>     mv reader01 $SLOT
> 
> done

Try it this way:

# modprobe loop
for SLOT in slot*; do
  echo "Mounting..."
  mount -o loop=/dev/loop0 $SLOT /mnt/cdsim1

  ls /mnt/cdsim1/D*

  echo "Unmounting..."
  umount /mnt/cdsim1
done

This is shorter, and easier to read. I guess it's also faster. :o)
(Well I also let the "-d" at the umount line go away. I'm not sure if you really
need it...)
(The modprobe line cannot be bad at all in such a script...)

Best regards,
 Oliver