Commit 24787f2c authored by Mike Hibler's avatar Mike Hibler

Force an fsck.ufs after localization of a FreeBSD filesystem.

Apparently there are some issues with UFS2 support in Linux.
Fsck mostly fixes incorrect block counts:
    INCORRECT BLOCK COUNT I=1043374 (0 should be 8)
for inodes that get created by Linux (e.g., /etc/ssh host keys,
/var/emulab/boot stuff). Everything seems to be fine after the fsck.

Also: specify "-Zy" when creating LVMs so that old GPTs, superblocks, etc.
don't leak through. LVM seems to be frightfully deterministic in its
allocation strategies to the extent that virtual disks created in previous
experiments have their metadata show up in newer experiment LVMs.
All the things that are changed
parent bf0e1d2f
......@@ -2161,6 +2161,12 @@ sub vnodePreConfig($$$$$){
}
done:
mysystem("umount $dev");
# XXX tmp
if ($vninfo->{'os'} eq "FreeBSD" && -x "$FSCKUFS") {
mysystem2("$FSCKUFS -yf $dev");
}
# XXX let vnodesetup exit early
if ($vsrelease eq "early" && $retval == 0) {
TBDebugTimeStamp("vnodePreConfig: touching $VMS/$vnode_id/running");
......@@ -5294,7 +5300,7 @@ sub createThinPool($)
}
# Try to make it
if (mysystem2("lvcreate -i$num -L ${poolsize}g ".
if (mysystem2("lvcreate -Zy -i$num -L ${poolsize}g ".
"--type thin-pool --thinpool $POOL_NAME $VGNAME")) {
print STDERR "createThinPool: could not create ${poolsize}g ".
"thin pool\n";
......@@ -5372,7 +5378,7 @@ again:
$flag = ALLOC_NOPOOL();
}
if ($flag == ALLOC_NOPOOL() || $flag == ALLOC_PREFERNOPOOL) {
if (!mysystem2("lvcreate -L $size -n $name -i${STRIPE_COUNT} ".
if (!mysystem2("lvcreate -Zy -L $size -n $name -i${STRIPE_COUNT} ".
"$VGNAME")) {
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment