cannot mount zip--totally strange
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.
Thanks,
Jake
strace results :
satchel[/home/jake]% strace mount -t vfat /dev/hdb4 /mnt/zip/
execve("/bin/mount", ["mount", "-t", "vfat", "/dev/hdb4", "/mnt/zip/"],
[/* 33 vars */]) = 0
uname({sys="Linux", node="satchel", ...}) = 0
brk(0) = 0x805b0a0
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=34653, ...}) = 0
old_mmap(NULL, 34653, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40016000
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\210\326"...,
1024) = 1024
fstat64(3, {st_mode=S_IFREG|0755, st_size=1170728, ...}) = 0
old_mmap(NULL, 1187168, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x4001f000
mprotect(0x40137000, 40288, PROT_NONE) = 0
old_mmap(0x40137000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x117000) = 0x40137000
old_mmap(0x4013d000, 15712, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4013d000
close(3) = 0
munmap(0x40016000, 34653) = 0
brk(0) = 0x805b0a0
brk(0x805b0c8) = 0x805b0c8
brk(0x805c000) = 0x805c000
open("/dev/null", O_RDWR|O_LARGEFILE) = 3
close(3) = 0
getuid32() = 0
geteuid32() = 0
lstat64("/etc/mtab", {st_mode=S_IFREG|0644, st_size=225, ...}) = 0
stat64("/sbin/mount.vfat", 0xbffff75c) = -1 ENOENT (No such file or
directory)
rt_sigprocmask(SIG_BLOCK, ~[TRAP SEGV], NULL, 8) = 0
mount("/dev/hdb4", "/mnt/zip/", "vfat", 0xc0ed0000, 0) = -1 ENOTBLK
(Block device required)
rt_sigprocmask(SIG_UNBLOCK, ~[TRAP SEGV], NULL, 8) = 0
stat64("/dev/hdb4", {st_mode=S_IFREG|0644, st_size=508, ...}) = 0
write(2, "mount: /dev/hdb4 is not a block "..., 62mount: /dev/hdb4 is
not a block device (maybe try `-o loop'?)
) = 62
_exit(32) = ?
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
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
Reply to: