Sunday, September 02, 2018

Re: resize /usr

On Sun, Sep 02, 2018 at 10:53:36AM -0700, Chris Bennett wrote:
> On Sun, Sep 02, 2018 at 04:16:57PM +0000, Ken M wrote:
>
> You can only do this if /usr/ports is directly after /usr.
> Use disklabel sd0 to get the positions.
>
> However, if /usr/ports is big enough and it's in the wrong spot, you can
> play games with switching them. I do this occasionally.
> If you can pull this off, use the n command in disklabel to rename /usr
> to something like /usr2 and /usr/ports as /usr/ports2, fiddle things
> around and then turn /usr2 into /usr/ports and /usr/ports2 into /usr.
>
> What I don't see is /usr/local and that makes things much harder unless
> you can pkg_delete everything and then re-install.
> You might find it much easier to ditch /usr/ports, add /usr/local to
> disklabel and another for /usr/ports that is much smaller.
>
> But we need to see your disklabel or any advice is hard to give.
> Also, by not having a /usr/local partition, your security is worse since
> that is the only partition that should use wxallowed in /etc/fstab.
>
> Basically, this is going to be really easy or really challenging.
> growfs works well. There is no such command as shrinkfs, but it can be
> done if well planned, usually. Or maybe not.
>
> Others may have different advice, but put up your disklabel sd0 here
> for sure.
> Just be glad you don't need to move /var. I've done it but ugh!
>
> Chris Bennett
>
>

Here is the output from disklabel

# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: SAMSUNG MZ7TE128
duid: ea188d6164482e5c
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 15566
total sectors: 250069680
boundstart: 64
boundend: 250067790
drivedata: 0

16 partitions:
# size offset fstype [fsize bsize cpg]
a: 2097152 64 4.2BSD 2048 16384 12958 # /
b: 8241536 2097216 swap # none
c: 250069680 0 unused
d: 8388608 10338752 4.2BSD 2048 16384 12958 # /tmp
e: 23823104 18727360 4.2BSD 2048 16384 12958 # /var
f: 31460960 42550464 4.2BSD 2048 16384 12958 # /usr
g: 41929664 74011424 4.2BSD 2048 16384 12958 # /usr/ports
h: 134126688 115941088 4.2BSD 2048 16384 12958 # /home

Frankly what probably makes the most sense is remounting /usr/ports to be
/usr/local. That probably makes the most sense. Frankly first doing this I am
sure I did not make the best decisions as I am still on the new side of using
OpenBSD.

Ken

No comments:

Post a Comment