Steven Hartland
2007-Mar-01 23:43 UTC
sysinstall creates corrupt filesystems after repartitioning
I've been repartitioning some of our machines here and
found that using the following method sysinstall creates
corrupt filesystems.
1. Boot a machine using an nfs mounted /usr
2. Run: sysctl kern.geom.debugflags=16 to enable writing
to the disk mbr
3. run sysinstall, Customise -> Label
4. Delete the /usr partition e.g. /dev/da0s1f
5. Create two partitions from the space left as ufs with
mount points /usr and /data
6. Write the changes.
Now two strange things happen:
1. /usr ends up mounted twice once from nfs and once
from the new ufs. This requires umount -f /dev/da0s1f to
correct but doesnt always work properly requiring a reboot
to restore system functionality.
2. The FS on both partitions is totally corrupt even fsck
cant repair them, even after a reboot.
So the question is why would sysinstall create two corrupt
FS's with this procedure?
Fixing is trivial just rerun the newfs commands and all
is good but its really odd that they should be corrupt
in the first place and caught me out big time when I first
did this as I had restored a full dump back onto /usr
and rebooted only for it to blow up horribly as the fs
was so badly corrupted.
Steve
===============================================This e.mail is private and
confidential between Multiplay (UK) Ltd. and the person or entity to whom it is
addressed. In the event of misdirection, the recipient is prohibited from using,
copying, printing or otherwise disseminating it or any information contained in
it.
In the event of misdirection, illegible or incomplete transmission please
telephone +44 845 868 1337
or return the E.mail to postmaster@multiplay.co.uk.
Sam Leffler
2007-Mar-02 09:45 UTC
sysinstall creates corrupt filesystems after repartitioning
Steven Hartland wrote:> I've been repartitioning some of our machines here and > found that using the following method sysinstall creates > corrupt filesystems. > > 1. Boot a machine using an nfs mounted /usr > 2. Run: sysctl kern.geom.debugflags=16 to enable writing > to the disk mbr > 3. run sysinstall, Customise -> Label > 4. Delete the /usr partition e.g. /dev/da0s1f > 5. Create two partitions from the space left as ufs with > mount points /usr and /data > 6. Write the changes. > > Now two strange things happen: > 1. /usr ends up mounted twice once from nfs and once > from the new ufs. This requires umount -f /dev/da0s1f to > correct but doesnt always work properly requiring a reboot > to restore system functionality. > 2. The FS on both partitions is totally corrupt even fsck > cant repair them, even after a reboot. > > So the question is why would sysinstall create two corrupt > FS's with this procedure? > > Fixing is trivial just rerun the newfs commands and all > is good but its really odd that they should be corrupt > in the first place and caught me out big time when I first > did this as I had restored a full dump back onto /usr > and rebooted only for it to blow up horribly as the fs > was so badly corrupted.There's a debug flag you can turn on somewhere in the sysinstall menus. It may help diagnose what sysinstall is doing wrong by checking the log msgs. I find sysinstall is best diagnosed inside qemu or vmware so you destructively operate on disk images w/o hosing a real system. Sam
Eric Anderson
2007-Mar-02 13:44 UTC
sysinstall creates corrupt filesystems after repartitioning
On 03/01/07 17:42, Steven Hartland wrote:> I've been repartitioning some of our machines here and > found that using the following method sysinstall creates > corrupt filesystems. > > 1. Boot a machine using an nfs mounted /usr > 2. Run: sysctl kern.geom.debugflags=16 to enable writing > to the disk mbr > 3. run sysinstall, Customise -> Label > 4. Delete the /usr partition e.g. /dev/da0s1f > 5. Create two partitions from the space left as ufs with > mount points /usr and /data > 6. Write the changes. > > Now two strange things happen: > 1. /usr ends up mounted twice once from nfs and once > from the new ufs. This requires umount -f /dev/da0s1f to > correct but doesnt always work properly requiring a reboot > to restore system functionality. > 2. The FS on both partitions is totally corrupt even fsck > cant repair them, even after a reboot. > > So the question is why would sysinstall create two corrupt > FS's with this procedure? > > Fixing is trivial just rerun the newfs commands and all > is good but its really odd that they should be corrupt > in the first place and caught me out big time when I first > did this as I had restored a full dump back onto /usr > and rebooted only for it to blow up horribly as the fs > was so badly corrupted. > > SteveI don't know about the fs corruption, but the double mounts is something you asked it to do (maybe unknowingly). When you added that partition, one of the options is to mount it. Eric