Archive for June 9th, 2010
After making what should have been a simple change to the partition layout on one of our FreeBSD 7.0 machines, where we split one partition into two. Upon writing changes sysinstall complained about missing directory for the second partition. It seemed it had created both partitions but only the first mount point directory. In addition the second partition label da0s3h wasn’t present so after creating the missing directory we rebooted the machine.
On reboot we where greeted by the error “Invalid partition table”. This was very worrying as the machine contained a large amount of data so was going to take ages to rebuild.
Our first thought was to reboot the machine from the livefs CDROM and attempt a repair but this failed as the CDROM emulation presented by the Supermicro IPMI, that we where using, wouldn’t play nice refusing to load with error = 5 from geom.
After much playing with various combinations we tried 8.1-BETA1 as a last resort, which to our surprise simply just worked 🙂
So now we could attempt a repair. sysinstall still showed all our partitions so it looked like all our data was intact. After a detailed inspection of the partition table using fdisk, it became apparent that for some unknown reason when we commited the changes to split the partition in two, sysinstall had marked all slices as active, which was confusing the boot loader.
To repair all we need to do was a simpple
fdisk -a da0, once this was done we had just the one active partition and the machine booted as normal.
Once booted we performed a fsck which refused to acknowledge the fs on the two new partitions. Running newfs and them mounting them fixed this.
So the moral of this story is don’t use sysinstall to split partitions or if you do ensure you correct the active state of the slices before rebooting 😉