On Thu, 2001-09-27 at 18:27, Jacob Stowell wrote: > Hi all, > > I just encountered a very strange situation, which has rendered my zip > drive un-mountable. I was modifying a shell script mentioned on this > list as a way to back up a certain directory to my zip drive. After some > doing, I finally got to a point where I actually got the script to work > properly. Once I got it to run, I umounted the zip drive and things > seemed fine. However, the next time I ran the script (just to make sure > it was working before backing up a more important directory, I got the > following error message: > > mount: /dev/hdb4 is not a block device (maybe try `-o loop'?) > > I get the same error if I try to mount it manually or through fstab. > The drive is recognized at boot time, but I cannot do anything with it > after that. The drive itself does not appear to have failed because I > could access it in windows. > > I have never seen this error before, and I am especially confused due to > the timing of the error. Being one of my first adventures into shell > scripting, I was wondering if there is anything in the script that could > be responsible for the scenario I described above. It seems so strange > that the drive would work one minute then be unresponsive the next. My > feeling is that it must have been something I did. Below is a listing > of the script I wrote and an strace of a mount command. Any help with > this puzzle would be greatly appreciated.
snip > Script: > > #!/bin/bash > > # Create backups of /etc, /home, /usr/local, and... > PATH=/bin:/usr/bin > > #backupdirs="/etc /root /boot /home /usr/local /var/backups > /var/cache/apt /var/ lib /var/log /var/www" > > backupdirs=" /home/jake/ping " > > mount /dev/hdb4 > > > for path in $backupdirs > > do > echo "System backup on $path" | wall > tar cvfz $path.tar.gz $path > cp $path.tar.gz /mnt/zip > sleep 2 > done > umount /dev/hdb4 > > echo "System backups complete, status: $?" | wall > echo "Now verifying system backups" | wall > > for path in $backupdirs > do > echo "Verifying $path...." | wall This part may have clobbered it. > tar tf /dev/hdb4 1>/dev/null && \ > echo "$path: verified" | wall || \ > echo "$path: errors in verify" | wall > if [ $? -eq 0 ] > then echo "$path: verified" > else echo "$path: error(s) in verify" 1>&2 > fi > done > > I think you may have clobbered your /dev/hdb file ls -al it and see if it's still a block device or it's been overwritten with something else. --mike