Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Dec 2006 09:15:20 -0800
From:      Garrett Cooper <youshi10@u.washington.edu>
To:        freebsd-questions@freebsd.org
Subject:   Re: How can I repartition my drive?
Message-ID:  <4575A928.7090509@u.washington.edu>
In-Reply-To: <20061205165431.GC34126@gizmo.acns.msu.edu>
References:  <499c70c0612042333k48ee9ec6n4cec1d7a89192071@mail.gmail.com> <20061205165431.GC34126@gizmo.acns.msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Jerry McAllister wrote:
> On Tue, Dec 05, 2006 at 10:33:54AM +0300, Abdullah Al-Marrie wrote:
>
>   
>> Hello,
>>
>> How can I repartition my drive? I already have the hd dedicated for
>> FreeBSD and 6.2-RC1 is installed.
>>
>> Is there away to make /var ..etc without reinstalling the OS?
>>     
>
> Well, I don't know what you mean by making /var ..etc, but there
> are things to do if you need to move some things to shift them
> to where there is more space.   For this you do not repartition,
> but just move certain directory trees and then make symbolic links.
>
> Here is an example.   Let's say you have a typical setup with one
> large /home file system that has lots of spare space, but you have
> begun to fill /var because you have lots of stuff in /var/log and /var/spool.
> So, you want to move the contents of /var/log and /var/spool in to
> the /home space where they have room to grow.   Do something like this:
>
> (While logged in as root - or booted to single user [preferred])
>   cd /var/log 
>   tar cvpf /home/log.tar *
>   cd /var/spool
>   tar cvpf /home/spool.tar *
>   cd /home
>   mkdir var.log
>   mkdir var.spool
>   cd var.log
>   tar xvf ../log.tar
>   cd ../var.spool
>   tar xvf ../spool.tar
>   cd /var
>   mv log log-old
>   ln -s /home/var.log log
>   mv spool spool-old
>   ln -s /home/var.spool spool
>
> Now, just check things out to make sure it is all OK.
>   cd /var/log
>   pwd             (should display /home/var.log)
>   ls              (should have the right stuff for log in it)
>   cd /var/spool  
>   pwd             (should display /home/var.spool)
>   ls              (should have the right stuff for spool in it)
>
> If all is well, clean up.
>   cd /var
>   rm -rf log-old
>   rm -fr spool-old
>   cd /home
>   rm log.tar
>   rm spool.tar
>
> That will leave space in /var and give log and spool to work
> The same type of thing can be done with other directories in overloaded
> file systems if you have room for them elsewhere.  Just don't do it for
> some things like /etc or /sbin that need to stay in root.
>
> There is something called growfs, but it is only useful if you have
> empty unallocated space right next to the partition you want to expand.
> That is rarely the case.   Most people put one partition right after
> the other without leaving wasted space in between.
>
> There are also some other utilities that claim to be able to mush FreeBSD 
> (as well as other types) partitions around, but I have not heard much about 
> them.   Most disk partition management utilities actually work on Microsoft 
> partitions which are what FreeBSD calls slices.   They do not know anything
> about FreeBSD partitions - which are actually subdivisions of slices.
>
> So, if you do not have the room to do the move and symlink process I
> describe above, then, you are probably needing to look at buying larger
> disk.
>
> Happy disk management,
>
> ////jerry
>   
>   
>> Thank you,
>>
>> Abdullah
>> Arab Portal
>> http://www.WeArab.Net/
>>     

    If you don't have any free partition space, you will need to backup 
a partition and delete it to resize things on your disk using 
sysinstall, which may require that you backup your entire disk and 
reinstall from scratch. For resizing NTFS partitions (if your system's 
dual-boot): <http://mlf.linux.rulez.org/mlf/ezaz/ntfsresize.html>. 
Googling for "resize {filesystem type}" will yield the answers to most 
questions that you might have about resizing any particular filesystem 
partition that you may have, but UFS2 support isn't available IIRC..
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4575A928.7090509>