Bash script clobbers something vital (lucid)

Colin Law clanlaw at googlemail.com
Sat Nov 19 08:47:00 UTC 2011


On 19 November 2011 06:10, Kevin O'Gorman <kogorman at gmail.com> wrote:
> 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.

Have a look in syslog and see what are the first errors that appear
there.  No need to get it to fail again for this, you can go back to
the previous log, assuming you know when it happened.  Also if you run
the disc utilities do you see any errors noted in the SMART data?

Are you doing anything else when it fails (plugging/unplugging
additional usb devices for example)?

Colin

>
> 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
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>



-- 
gplus.to/clanlaw




More information about the ubuntu-users mailing list