View Single Post
  #7   (View Single Post)  
Old 27th December 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
Join Date: May 2008
Location: USA
Posts: 7,106

There is a simple solution, since the unused partitions "i" (/usr/src) and "j" (/usr/obj) follow immediately after partition "h" (/usr/local) on the drive. You can delete them, and grow /usr/local into these unused 7.5GB. Those two unused partitions are for building the system from source code.
  1. Enter single-user mode.
    You can boot into it with boot> -s or "drop" into it with# kill 1. If you've booted, no filesystems are mounted (except for a read-only root) and no network will have been started. If you started with a running system, your network and mounts will remain as when multi-user.
  2. Back up your current system.
  3. Unmount all three partitions: /usr/local, /usr/obj, and /usr/src, with umount(8), if these are already mounted.
  4. Remove the /usr/src and /usr/obj entries from your /etc/fstab file. See fstab(5) if you have any questions about this file.
  5. Edit the disklabel, removing the "i" and "j" partitions, then increasing the size of the "h" partition to cover the newly freed space. Don't blindly rely on my example below, please review the disklabel(8) man page and the interactive editor commands.
    # disklabel -E sd0
    Label editor (enter '?' for help at any prompt)
    > d i
    > d j
    > m h
    offset: [21552320]
    size: [8347936] *
    FS type: [4.2BSD]
    > q
    Write new label?: [y]
  6. Increase the size of the /usr/local filesystem to match the new increased size of the partition with growfs(8), then mark the filesystem clean with fsck(8). As above, read the manual, don't trust this example I created for you:
    # growfs sd0h
    We strongly recommend you to make a backup before growing the Filesystem
     Did you backup your data (Yes/No) ? Yes
    new filesystem size is: 5999104 frags
    Warning: 361024 sector(s) cannot be allocated.
    growfs: 11540.7MB (23635392 sectors) block size 16384, fragment size 2048
        using 57 cylinder groups of 202.47MB, 12958 blks, 25984 inodes.
    super-block backups (for fsck -b #) at:
     8707808, 9122464, 9537120, 9951776, 10366432, 10781088, 11195744, 11610400, 12025056, 12439712, 12854368, 13269024, 13683680, 14098336, 14512992,
     14927648, 15342304, 15756960, 16171616, 16586272, 17000928, 17415584, 17830240, 18244896, 18659552, 19074208, 19488864, 19903520, 20318176,
     20732832, 21147488, 21562144, 21976800, 22391456, 22806112, 23220768
    # fsck -p /dev/sd0h
    /dev/sd0h: 1 files, 1 used, 5815358 free (14 frags, 726918 blocks, 0.0% fragmentation)
At the moment, you aren't building the OS from source code, so this is a safe change. Should you determine later that you want to do this, you can back up your /home partition and restructure the 8.1GB there to recreate these partitions.

Last edited by jggimi; 27th December 2018 at 03:00 AM. Reason: added red highlights in the examples
Reply With Quote