|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Resizing /usr
Hey all
My current situation is as follows: windows 20GB free 20GB FreeBSD 7.XXGB -- / 500MB -- /tmp 300MB -- /usr 6GB -- /var 500MB Ubuntu 30GB As the title suggests, I want to resize my /usr partition to occupy the free 20GB. Please note: 1) I have no other drive to backup FreeBSD to 2) I am not connected to any other machine to which I can send the data 3) This is my laptop, and I'm willing to experiment anything that may lead to loss of data, as long as it might work 4) I am NOT willing to reinstall, I have just built too much from source and it has taken a long time.. 5) I'm kinda new to FreeBSD... I've searched around for a while, but found nothing interested.. Any help? Thanks Last edited by abdo88; 7th July 2008 at 04:12 PM. Reason: Adding partitions in FreeBSD slice |
|
|||
Thanks for the reply... From your reply, you probably work on Linux... I'm not having any problem with home... However, my major concern is with /usr (this is where all the action goes on...) especially that I'm intending to build X and KDE..
About dumping, dump to where? I have no other hard disks and no network connections... |
|
|||
Easier problem...
OK, here is an easier problem.... If I archive /etc, /boot and /usr and burn the archives to CDs/DVDs... If I reinstall and paste these back, will my exact same system be back the way it was??
Last edited by abdo88; 7th July 2008 at 05:27 PM. |
|
|||
You can use geom(8) gconcat(8) utility for adding aditional free space to /usr label.
Explore GEOM and its modules for more information. Note that philosophy is different than what is currently provided in other alternative operating systems. |
|
|||
Was that a reply to my first or second question ?
In either case, could you please elaborate a bit more? |
|
|||
For your first question, second one is dumb.
Read both manual pages, provided as link in my previous post. Than read other manual pages listed in SEE ALSO in every manual page. |
|
||||
Quote:
In situation like this I move /usr/ports (and if necessary /var/tmp) to /home and make symbolic link to them... This is how i compiled OpenOffice on my PC After that i move them back / 512M /tmp 512M /usr 12GB (ain't enough to compile OpenOffice, only 5.3GB is free) /var 3GB Note that if you do like i did, then later recompiling some other apps, make sure to remove work (or what was the correct name) directory, otherwise there will be problems during compilation Last edited by graudeejs; 7th July 2008 at 06:29 PM. |
|
|||
That's actually quite a nice idea!! It never occurred to me... So one more question how do I enlarge the FreeBSD slice (partition magic et al. won't recognize it)?
Last edited by abdo88; 7th July 2008 at 06:45 PM. |
|
||||
How much you free space you got on Ubuntu drive????
If it's enough, you could use it to store /usr backup... you will need 1 to 6 GB free space (depends if you will or not compress backup).... hmm, but restore works only on UFS, so you might need to use tar, but that might make some problems (with links maybe, idk, read man tar) Last edited by graudeejs; 7th July 2008 at 06:36 PM. |
|
||||
*My Personal Opinion*
Use the free 20GB to create a new slice with several partitions, where ever your 'bulges' will be and mount them or create a big slice/1partition and symlink them from a diff mount point. It is less trouble then relabing the disk and having to go through updating stuff, especially since you have so little backup options and extra disk space available for it. e.g. freespace -> ad0sX ad0sXa -> /usr/local ad0sXb -> /usr/src ad0sXd -> /usr/obj ad0sXe -> /usr/ports or ad0sXa -> /where/ever and create sym links to /usr/{obj,src,ports,local} to /where/ever/{obj,src,ports,local}. For example, my file server recently got a second hard drive. I dumped the contents of /usr/local, deleted the old, formated a slice with a partitioin for it and mounted it on /usr/local and then restored the files.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
Great idea! Thanks
Thanks a lot! This seems so far like the (almost) optimal solution...
However, I have 2 questions in mind: 1) Can I change the partition mounted as /usr ? 2) If yes, can the new /usr partition be on a different slice? If the answer to the above 2 is yes, I am thinking of making the 20GB free space into a /usr and using the 6 for smthg else (e.g. /home)... EDIT: that is make the 20GB another 1-slice partition.. EDIT: in case this works, will it hurt the performance? if yes, to what extent? Last edited by abdo88; 7th July 2008 at 11:37 PM. |
|
||||
yeah as long as you update the /etc/fstab file correctly.
basically some thing like this would *probably* work: Code:
# fdisk ad0 ... use fdisk to create the partition from the free space, hence forth called ad0sX # bsdlabel -e ad0sXa ... create the disk label for the new slice # newfs /dev/ad0sXa # mount /dev/ad0sXa /mnt # tar -cf - -C /usr . | tar -xvpf - -C /mnt ... copies files over vi /etc/fstab ... change the device being mounted on /usr ... if you have a preferred screen editor instead of vi, feel free to use it reboot Code:
# mount /dev/ad0sYz /mnt .. where ad0sYz was your old /usr partition (e.g. ad0s3e in the above) # rm -rvf /mnt/* It's not exactly how I would do it but close enough. The reason for the reboot is because you may have programs stored in /usr that are running while doing this and it is best not to delete the data files while running the programs! Rebooting is not necessary but, you could say makes the process simpler to follow without bringing the system to single user mode (which would generally be best imho). Note: I have not used FreeBSDs 'bsdlabel' in ages and of course assume no responsibility for the accuracy or inaccuracy of any of this. If your not familiar with using bsdlabel you can always use the -n switch to it which will do a 'dry run' that won't *actually* write changes out, e.g. bsdlabel -ne ad0
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. Last edited by TerryP; 8th July 2008 at 12:18 AM. |
|
|||
Thanks a lot for the help... Unfortunately, I had to just give up and reinstall BSD... since I cannot create more than 4 primary slices :S...
Anyways, thanks a lot to all those who helped... |
|
||||
Quote:
__________________
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." MacBook Pro (Darwin 9), iMac (Darwin 9), iPod Touch (Darwin 9), Dell Optiplex GX620 (FreeBSD 7.1-STABLE) |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Resizing FreeBSD partition | Cloud | FreeBSD General | 3 | 28th June 2008 03:40 AM |