Resize Freebsd slice

I have both FreeBSD and windows xp installed (single disk). Now I want to get rid of windows by deleting the windows partition and merging it into the FreeBSd slice. I tried sysinstall -> configure -> fdisk,
2yxembl.jpg


where the 2nd and 5th slices are associated with windows xp. But I don't know what to do next without losing my data on the existing FreeBSD slice. I don't want to reinstall FreeBSD.
 
Why? He may not be able to merge everything back into a single slice, but at least he can edit the MBR using fdisk(8), change the sysid of his Windows partitions to 165 and reclaim all the space with newfs(8).
That should work and he shouldn't lose too much space for the extra slices.
 
Beastie said:
Why? He may not be able to merge everything back into a single slice, but at least he can edit the MBR using fdisk(8), change the sysid of his Windows partitions to 165 and reclaim all the space with newfs(8).
That should work and he shouldn't lose too much space for the extra slices.

I would install GAG or FreeBSD loader before touching anything or at least make sure he has no need of NFTS to boot. In case he's using windows bootloader to start FreeBSD he might get in trouble just bashing the ntfs partition without care.
 
While it may be possible to reclaim the space in s1 and s3, it will not be pretty. :)

First, make sure you can boot without using any DOS/Windows tools. Either install a boot manager into the MBR, or overwrite the MBR with the standard FreeBSD one. Either way, mark s2 as the active partition.

Then use sade(8) (don't ever use sysinstall except to install the OS), delete s1 and s3, create new s1 and s3. Then create a single partition in each slice and format them. Finally, mount those new filesystems somewhere.

The ugly part comes with deciding where to mount the new filesystems, and how to replace existing directories (/usr/local or /home, for instance) with these filesystems. :)

Much cleaner to just backup, reinstall with a single slice, and go from there.
 
Buy an external drive, tar your root filesystem and save it on the external. Then boot with a livecd, reformat the disk how you like, and extract the tar to your new slice. Time consuming, perhaps, but it will end up like nothing happened, and you'll have the extra space of the windows partitions to mount /usr or /home to or however you like to setup your system.
 
Back
Top