External disk strangeness..

Status
Not open for further replies.

mute

Dabbler
Joined
Dec 8, 2013
Messages
19
Has anyone ever seen this?

Code:
[root@system] /mnt# cat f.sh
#!/bin/bash
 
for i in `seq 1 10`
do
    mount -t ext2fs /dev/da78s1 /mnt/usb
    cd /mnt/usb
    md5 somefile-2014-03-27-1102.tar.gz.enc
    cd /mnt
    umount /dev/da78s1
done
 
 
[root@system] /mnt# sh f.sh
MD5 (somefile-2014-03-27-1102.tar.gz.enc) = 4183d779c3c727aa3d0c8e224b9ab76f
MD5 (somefile-2014-03-27-1102.tar.gz.enc) = f39b43c45bfe010d8a0ca254888238b1
MD5 (somefile-2014-03-27-1102.tar.gz.enc) = 401347bda2d1944d6d1e506f66ed5747
^C
 


A little background: I have a cronjob that runs, mounts an external USB drive that is formatted ext2, backs up some files and then unmounts the drive. The issue is that the files on the drive seem to change every time the drive is either mounted or unmounted, and for the life of me I can't figure out why.

I've tried adding sleeps, syncs, etc to the script to ensure that it's completely written to disk prior to unmounting the drive to no avail..

I realize this is a little off topic but I'm totally stumped.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
LOL. That's not good at all.

You have bad RAM?

USB isn't exactly "stable storage".

ext2 shouldn't be used except as read-only. Had many people lose their ext2 partitions because they wrote files to it. And since you have no way to run a fsck on ext2 in FreeBSD, you have no way of identifying or correcting the problems without putting it on a linux box.
 

mute

Dabbler
Joined
Dec 8, 2013
Messages
19
Well, this is on a TrueNAS system that's been running just fine for months (scrubs don't repair anything, etc). I realize the futility of relying on USB for backups, this is really like a last resort sneakernet backup of some important documents.

I'm not married to ext2, but I'm having a hard time coming up with a suitable filesystem to format this drive -- the files I'm backing up are too big for FAT32 and I don't really want to have to split them up. Any suggestions?

I should also mention that I've tried multiple USB drives to rule that out.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
ZFS works great on USB. That's what some people do for their primary storage. Granted it's not a good idea at all, but people do it all the time nonetheless.

Edit: Ok.. I'll say that ZFS "works" on USB. It's not recommended you use USB at all, but it does work. and as a backup of a backup it's probably a safe bet.
 

mute

Dabbler
Joined
Dec 8, 2013
Messages
19
I considered that (or UFS) but my concern is that the person who sneakernet's this drive home (the CEO) is not going to be able to just plug it in somewhere and have it "just work". I've really got to convince him just to have me push this to the cloud or dropbox it or something..
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
*cough* rsync.net *cough*

-or-

*cough* crashplan *cough*

rsync.net works VERY well. i'm working on a guide for it.. to be released someday.
 
Status
Not open for further replies.
Top