# Moving & resizing partitions/slices



## Lorem-Ipsum (Oct 31, 2012)

Until recently I've had FreeBSD and Windows 7 dual booted with the following partitions:
Windows reserved (100mb)NTFS
Windows 7(235Gb)NTFS
Freebsd(235Gb)UFS

I've shrunk windows and am replacing windows 7 with 8.
I now want to use the space left for FreeBSD.


The current partition setup is as follows:
Windows reserved (100mb)NTFS
Windows 8(100Gb)NTFS
Free Space(135Gb)
Freebsd(235Gb)UFS

I've done some reading on how FreeBSD does slices and partitions and from my understanding, in my FreeBSD slice, /usr is on the last partition.
As I want /usr to occupy the free space I'm guessing I have to move the entire FreeBSD slice to the beginning of the free space, then enlarge the slice, then use growfs to enlarge the /usr partition.

I have done a fair amount of reading but I'm just getting used to FreeBSD and could do with some help.

Thanks in advance,

Matt


----------



## wblock@ (Oct 31, 2012)

Back up the whole disk, all partitions including Windows.  Back up the FreeBSD partitions with dump(8)/restore(8) (see Backup Options For FreeBSD).

Then delete the slice containing FreeBSD, reallocate a new slice, and restore the FreeBSD backup to it.

PS: your partition notation is very hard to read.  Please just put each partition on a different line, or show the output gpart(8) show.


----------



## jb_fvwm2 (Oct 31, 2012)

If you can somehow[1] make the empty space a 165 (165/a5h in BootIt (shareware) terminology) 
[1] I know how, but it varies instance-per-instance
...and make it a filesystem (newfs etc...
Then you can rsync /usr to it and rewrite fstab so /usr  is now contained there. Then if that works, remove the files in the old /usr...
Just one more way. Don't know if it is the easiest or not. (Stuff happens...)


----------



## Lorem-Ipsum (Nov 1, 2012)

wblock@ said:
			
		

> Back up the whole disk, all partitions including Windows.  Back up the FreeBSD partitions with dump(8)/restore(8) (see Backup Options For FreeBSD).
> 
> Then delete the slice containing FreeBSD, reallocate a new slice, and restore the FreeBSD backup to it.
> 
> PS: your partition notation is very hard to read.  Please just put each partition on a different line, or show the output gpart(8) show.



Wow, I've heard about dump/restore. Never really read up on it. Looks fantastic!

My machines are all on a gigabit network and My main rig has about 1Tb of free space so it looks like I'm all set. I'll leave it until the weekend just in-case something goes wrong.


----------

