Bash script clobbers something vital (lucid)
Karl Auer
kauer at biplane.com.au
Sat Nov 19 23:58:49 UTC 2011
On Sat, 2011-11-19 at 14:21 -0800, Kevin O'Gorman wrote:
> > Post the script.
>
> Attached. It's in three parts
At first blush, I'd say you need to check the inputs more carefully -
when you are playing around with fdisk and dd, it's essential that the
parameters are correct. So in bkfuncts.sh, I'd be wrapping some serious
error checking around those exported variables, especially drive and
loc. It may not have anything to do with the current problem, but it
will probably save you somewhere down the track.
> everything on the local machine. The problem happens in the middle
> of this script.
Locating exactly where a bug happens is pretty much the first step to
fixing it. If the symptom is that the drive is no longer readable, then
set up a telltale file and check at likely points in your scripts that
it still exists. If you suddenly can't find it or read it, the failure
has happened between that point and the last point where you could see
it. That narrows down the debug space.
If you can reduce the magnitude of the backup while you debug, it will
speed your debugging - can you set up a virtual with small disks and and
run all this stuff on the virtual? If it doesn't happen on the virtual,
that's interesting information too.
> If I comment out all of the commands
> that worked, running the shell starts computing the md5sum's okay.
If you know what commands worked, presumably you know which command
didn't... do you know which command failed?
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au) +61-2-64957160 (h)
http://www.biplane.com.au/kauer/ +61-428-957160 (mob)
GPG fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687
Old fingerprint: B386 7819 B227 2961 8301 C5A9 2EBC 754B CD97 0156
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20111120/56e92cca/attachment.sig>
More information about the ubuntu-users
mailing list