Solved Oops!

I thought I would try out the gpart resize to try and create an extra partition on a disk which was largely free, ie resize to a smaller value than it was originally. No error msg came up so I thought it had worked. Unfortunately on reboot the bootloader comes up but the kernel is not accessible.

Also when trying to mount the amended partition when booting from another drive I get a numerous I/O errors, although some directories are still accessible.

Is there any way to recover?
 
gpart resizes partitions, but not filesystems residing in them. Not all filesystem types can be shrunk down. You never know how your files are scattered around the partition, some of them are still acessible. The best think you can do is resizing it back. Then run fsck* on it before mounting. There is no guarantee it will be completely recovered though.
 
Yeah, you can try and put the original partition information back. If the part that's been cut off hasn't been overwritten yet it should still be there and you might be able to recover it.
 
And the way to go *if* you want to shrink a partition is to *first* shrink the filesystem and only then shrink the partition. That said, I don't know how (and whether at all) this is done with UFS or ZFS, because I never needed it so far.
 
Back
Top