Bash script clobbers something vital (lucid)
Kevin O'Gorman
kogorman at gmail.com
Sun Nov 20 01:04:22 UTC 2011
On Sat, Nov 19, 2011 at 4:13 PM, Kevin O'Gorman <kogorman at gmail.com> wrote:
> On Sat, Nov 19, 2011 at 7:34 AM, Colin Law <clanlaw at googlemail.com> wrote:
>> On 19 November 2011 14:36, J <dreadpiratejeff at gmail.com> wrote:
>>> On Sat, Nov 19, 2011 at 03:47, Colin Law <clanlaw at googlemail.com> wrote:
>> Are you suggesting that if the data has not been completely written
>> then trying to read it back will give issues? That does not make any
>> sense to me. If the data is still available in the cache then it will
>> be read back from their anyway.
>>
>> This does suggest a possible issue however. Kevin, does the script do
>> something after completing the writes to ensure that the md5sum is
>> read back from the device rather than the cache? Perhaps it is
>> accidentally unmounting the device.
>
> The script does not do anything like that. It does not mount or
> dismount anything. Given a choice, I'd checksum the cache I guess,
> but I have not been much concerned about it. The md5sum is there to
> validate the files if I am going to go back and use them. You may
> notice that the script sets them all with the "immutable" attribute,
> but I like to test that with the checksum. It's also there because I
> have inadvertently deleted some backups in the past, and I don't ever
> want to do that again by accident.
Hmm. Pondering this just after sending it, I wonder if the problem
could be caused by the "chattr" command occurring while the cache is
still dirty. It's the first plausible thought I've had about how this
could occur, given what I know about OS'es. I'll try sticking a few
"sync" commands in there.
--
Kevin O'Gorman, PhD
More information about the ubuntu-users
mailing list