Automatic fsck
Andrew Sayers
andrew-ubuntu-devel at pileofstuff.org
Tue Aug 12 19:13:37 UTC 2008
Apologies for replying to myself, but I remembered that Google exists :)
Apparently snapshot merging is currently in beta:
http://kerneltrap.org/Linux/LVM_Snapshot_Merging
Also apparently, LVM2 ensures filesystem integrity when creating
snapshots: http://tldp.org/HOWTO/LVM-HOWTO/snapshotintro.html
I assume that the equivalent of "umount $snapshot" is done within the
kernel when the snapshot is created, because it gives you a new
non-mounted block device. It's therefore possible to do fsck from cron.
By way of a test, I fsck'd my mythtv partition while recording TV:
# export VOLGROUP=nautilus # name of my volume group
# export VOLUME=mythtv # name of my MythTV volume
# export BACKUP=$(lvcreate -L1024M -s /dev/$VOLGROUP/$VOLUME \
| cut -d\" -f2)
# if e2fsck -f "/dev/$VOLGROUP/$BACKUP" ; \
then tune2fs -C 0 "/dev/$VOLGROUP/$VOLUME" ; \
else echo "warn the user somehow" ; \
fi
e2fsck 1.40.8 (13-Mar-2008)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
mythtv: 1268/13107200 files (13.5% non-contiguous), 23812139/26214400 blocks
tune2fs 1.40.8 (13-Mar-2008)
Setting current mount count to 0
# lvremove -f "/dev/$VOLGROUP/$BACKUP"
Logical volume "lvol0" successfully removed
In other words, this worked fine for me. The partition was free from
errors and the recording was unharmed.
- Andrew
More information about the Ubuntu-devel-discuss
mailing list