File system bafflement

R Kimber richardkimber at btinternet.com
Wed Sep 3 10:48:49 UTC 2014


On Tue, 02 Sep 2014 16:49:15 -0400
Paul Smith wrote:

> Sorry, I missed the first few messages.  There is no way, short of a bug
> in the kernel, that anything can write data "behind" a mounted
> partition.
> 
> If I understand you correctly, it sounds like the USB backup disk became
> unmounted somehow then was mounted again before you noticed.

Initially, the disk was kept unmounted and my backup script mounted it and
then used rsync to do the backup and then unmounted the disk again.
However, something somewhere (automount?) kept trying to access the disk
periodically (I did post about this some time ago because it was
sufficiently noisy as to be irritating but couldn't find a solution).
Whether that is relevant I don't know.  I don't have enough understanding of
how the system works, but when the dodgy drive failed to mount I guess that
the script, which checked for the existence of /media/zip, just wrote to
that directory, rather than only writing if the mount was successful, and I
assume that was the real cause of the problem.

> That would explain the problems: first the backup disk is unmounted (by
> hand or USB unplugged or powered down or something) so the bash script
> was backing up files to a directory it thought was the backup disk but
> was really the root partition, filling it up.  When that happened the
> backup failed because it ran out of space.  Then somehow the backup disk
> partition was re-mounted, either by hand or it was plugged back in to
> the USB port or whatever, and that "hid" the old backup files.
> 
> You can change your scripting to ensure that the partition being used
> for backups is really a separate partition, not root, if you want to
> avoid this kind of failure in the future.

I'll have to look into the best way of doing this.  I'm not a professional
so my script no doubt needs improving.

Many thanks for all the helpful comments from everyone.

- Richard.
-- 
Richard Kimber





More information about the ubuntu-users mailing list