Bash script clobbers something vital (lucid)

Kevin O'Gorman kogorman at gmail.com
Sat Nov 19 06:10:32 UTC 2011


I've been tweaking a backup script.  It's not going all that well.
The end result is that something really bad happens to the drive that
stores the backups.  Fortunately it's not permanent, but it does
require a reboot (!).

The script makes gzipped  tar, ntfsclone and dd backups to a new
directory on an external drive.  All of the backup files have been
made when a problem starts with the backup drive.
The script is about to take md5sum's of all the new backup files and shut down.
The problem is that all attempts to access the backup drive result in
failure, reported as an IO error.  Even attempts to unmount the drive
fail -- even in a new shell.
The backup drive is a new (1 month old) Seagate 2TB SATA in an
external dock connected by USB.

The shell logic seems okay.  If I reboot the system and fsck the
backup drive, all seems working.  If I comment out all of the commands
that worked, running the shell starts computing the md5sum's okay.

Since the system is showing damage that no shell command could cause
(requiring a reboot to access the drive), and for other reasons, I'm
not thinking the script is buggy.  Even if it were, it should not be
able cause this sort of problem.

Has anybody seen this?  I've used Linux since ~ 1992, and I never have.

It's going to be a bear to make this reproduceable.  It happens every
time on this laptop, but only after backing up my partitions and data,
and that takes 4 hours (133 GB after compression).  I don't even know
how to make a sensible bug report out of this.

-- 
Kevin O'Gorman, PhD




More information about the ubuntu-users mailing list