|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
How to resize /usr/local partition?
Hi,
I installed OpenBSD 5.7 on a VMware machine with an hdd of 10GB. Now, i cannot install any prackage because /dev/wd0h (/user/local) is full. I try to find a solution but without success I resize my virtual hdd (from VMware) from 10GB to 15GB, but if I try to resize /dev/wd0h partition the system tell me it is busy. The attached file is the output of my partitions (where C I think is the space I added): |
|
|||
Quote:
I have "h" partition with 2.2GB and I want to resize it without copy it on another partition. So, in the 3rd step I type disklabel -E and then? Thanks |
|
||||
You cannot grow a partition's size unless there is unallocated storage immediately following the partition. Immediately following your /usr/local partition is your /usr/src partition, and then your /usr/obj partition. If you are not using them, you could delete them, then use growfs(8).
The steps I described above assumed you want to keep them. --- Option 1: Keeping /usr/src (and /usr/obj) partitions Per step 5 above, use # disklabel -E wd0 to enter the disklabel editor.You would use "b 64 *" to set the OpenBSD range from sector 64 to the end of the drive. You would use "a" to add a new partition. It will prompt you for a partition letter, starting sector, and size. The default start point will be the first free sector, which is located between the end of your "b" partition and the start of your "d" partition, and isn't what you want. Set your starting sector to a location beyond the end of home (from sector 21065640 or beyond) and then pick the new size you want, the default will be the end of the free space, and you may choose less using "g" or "m" to pick GB or MB, if you wish. Use "q" to quit. You'll be prompted to confirm an update to the disklabel. Then, format the new partition -- I'd left this out of my simple "How To" above. # newfs wd0l After this, mount it and copy the contents, as shown in the "How To". --- Option 2: Eliminating (or moving) /usr/src and /usr/obj partitions 1. When in single-user mode, dismount the partitions you will revise and remove. # umount /usr/local # umount /usr/src # umount /usr/obj 2. Use your disklabel editor to delete the "i" and "j" partitions. # disklabel -E wd0 d i d j 3. While in the editor, increase the size of the "h" partition into the newly created free space. m h (when you reach the size, change it) q 4. Run growfs(8) to increase the size of the filesystem in the resized "h" partition. # growfs wd0h 5. Run fsck(8) to check the disk. The disk is always marked "dirty" by growfs and requires an fsck(). # fsck /usr/local 6. Optionally, recreate the "i" /usr/src and "j" /usr/obj partitions with disklabel(8) and format them with newfs(8). 7. If you did not recreate the partitions, edit your /etc/fstab to remove them. Last edited by jggimi; 26th October 2015 at 02:24 PM. Reason: typos, again |
|
|||
Thank you very much!
|
|
|||
Quote:
|
|
||||
Disclaimer: you are asking me about a post I wrote more than seven years ago.
Quote:
Quote:
The original /usr/local partition was "h". The new /usr/local partition will be "l". Step 3 creates the new partition, Step 4 mounts the new partition as /mnt (temporarily), Step 5 copies the data from the old to the new partition, and Step 6 replaces it in the list of partitions to mount during boot. |
|
|||
Quote:
Step 6: was not clear enough if the mount point in fstab was /usr/local or /mnt as long as the /usr/local (old h was erased (or is going to be erased in Step 6. For me /usr/local has no data (newly created 'i:' partition) and old /usr/local data is still mounted on /mnt. Sure I am missing something. Thanks! |
|
|||
Quote:
|
|
||||
Quote:
|
|
|||
Quote:
It is about this old thread, if you open the attachment (Capture.JPG (46.3 KB, 266 views)) on OP you will see the numbers. Thanks for taking the time to read this Last edited by lattimro; 4th December 2022 at 11:39 PM. |
|
||||
There are 185 sectors free at 20964640, as you noted. There are also 20 sectors free at 1270412, which is hard to find without either doing manual arithmetic or recreating this disklabel in a vnode(9) and letting disklabel show where the free sectors were hiding. Which is what I did to find them.
The original /usr/local filesystem was copied to the new filesystem at the temporary mount point /mnt using dump(8) and restore(8). A mount point is nothing more than a directory. The edit of the fstab would be to revise the partition mounted at /usr/local from the "h" partition to the new "l" partition. |
|
|||
Quote:
Yes, you got 205. I do know now how you got these numbers! Last edited by lattimro; 8th December 2022 at 11:00 AM. |
Tags |
partitioning, resize /usr/local |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
resize root partition of my server | Tzzzzzzzz | OpenBSD Installation and Upgrading | 15 | 2nd June 2014 10:23 PM |
mysql won't run via rc.local | benben159 | OpenBSD Packages and Ports | 3 | 8th August 2010 02:41 PM |
log from rc.conf.local and rc.local | sdesilet | OpenBSD General | 1 | 21st January 2010 02:37 AM |
tmux disable automatic resize | Carpetsmoker | General software and network | 7 | 25th June 2009 10:54 PM |
local dns (dnsmasq) | bsdperson | FreeBSD Ports and Packages | 3 | 3rd September 2008 06:48 AM |