Re: resize /usr
As a follow up I did manage to get everything sorted out. Redid the disk labels and used newfs and well in single user mode had to use ed to cleanup the fstab. After that booting bsd.rd to reinstall sets and then a restore from backup on a usb I made of what I would be hitting and all seems well. Well better... $ df -h Filesystem SizeUsed Avail Capacity Mounted on /dev/sd0a 1005M250M704M26%/ /dev/sd0h 62.9G 19.2G 40.6G32%/home /dev/sd0d 3.9G288K3.7G 0%/tmp /dev/sd0f 4.9G1.0G3.7G22%/usr /dev/sd0g 19.7G 11.0G7.7G59%/usr/local /dev/sd0e 11.2G 56.2M 10.6G 1%/var /dev/sd0i 9.8G1.1G8.2G12%/usr/ports $ mount /dev/sd0a on / type ffs (local) /dev/sd0h on /home type ffs (local, noatime, nodev, nosuid, softdep) /dev/sd0d on /tmp type ffs (local, noatime, nodev, nosuid, softdep) /dev/sd0f on /usr type ffs (local, noatime, nodev, softdep) /dev/sd0g on /usr/local type ffs (local, noatime, nodev, nosuid, wxallowed, softdep) /dev/sd0e on /var type ffs (local, noatime, nodev, nosuid, softdep) /dev/sd0i on /usr/ports type ffs (local, noatime, nodev, nosuid, wxallowed, softdep) Should /usr/ports be mounted wxallowed. I was thinking no, but I recall running into an issue when it wasn't.
Re: resize /usr
On Tue, Sep 04, 2018 at 10:06:52AM -0700, Chris Cappuccio wrote: > > Just move /usr/ports back to /usr and remount /dev/sd0g as /usr/local A perfectly reasonable suggestion, something I thought about. I kind of want to tweak this and learn a little bit to make things better so I am going to give the aggressive approach a try as I have a few days down time coming up. I made a quick backup of everything in /etc /usr /home and captured my current installed package list just to be safe. My plan is to split /usr and /usr/ports into /usr /usr/local /usr/ports. Haven't really decided how much space for each. I am going to think about it in the interim. As a development laptop I don't really need a separate /var perhaps. And then I can claim some extra space in home... Perhaps I like to tinker too much... Ken
Re: resize /usr
Ken M [k...@mack-z.com] wrote: > > $ df -h > Filesystem SizeUsed Avail Capacity Mounted on > /dev/sd0a 1005M245M710M26%/ > /dev/sd0h 62.9G 21.7G 38.1G36%/home > /dev/sd0d 3.9G302K3.7G 0%/tmp > /dev/sd0f 14.8G 11.6G2.5G82%/usr > /dev/sd0g 19.7G1.1G 17.6G 6%/usr/ports > /dev/sd0e 11.2G 56.1M 10.6G 1%/var > > Above is my current disk setup, what I would like to do is shrink /usr/ports > to > grow /usr. > Just move /usr/ports back to /usr and remount /dev/sd0g as /usr/local
Re: resize /usr
On Mon, Sep 03, 2018 at 06:11:24PM -0500, ed...@pettijohn-web.com wrote: > > This obviously isn't the officially recommended way to do it, but it works > here. > > I put everything in my $HOME and use symlinks to trick the build system into > thinking it's in /usr/ports, etc. Thus, no need to fool with partitions. > > Edgar Considering the generally smaller size of the built in HD on this laptop, that is not a bad solution to not having to deal with changing priorities in the system. Ken
Re: resize /usr
On Sep 3, 2018 4:33 PM, Ken M wrote: > > On Mon, Sep 03, 2018 at 03:59:07AM +0200, Ingo Schwarze wrote: > > Hi Ken, > > > > How exactly to distribute space among partitions really depends on what > > you want to use the machine for. The disk you are showing above can be > > called terribly small nowadays (though i admit that i used disks in > > production with OpenBSD 2.7 17 years ago that were more than 1000 > > times smaller), so small that you are likely to run out of space > > sooner or later even if you don't let waste data lying around. > > > > Yes, you always want /usr/local/, except maybe on a pure firewall router > > where you are not planning to install any ports whatsoever except rsync. > > > > I see you do not have /usr/src/, /usr/obj/, /usr/xenocara/, > > and /usr/xobj/, so you are obviously not planning to work on patches > > to the base system or to X11. Nothing is wrong with that. If you ever > > start doing such work on that machine, you will have to bite off the > > required partitions from home, though. It would have been smarter if > > you had left at least 10G at the end of the disk unallocated; if you > > ever needed some partition like that, you could create it without a fuss; > > if /home/ ever got full, you could move some stuff there. > > > > I see you do have /usr/ports/, so obviously, you are planning to do > > some work on ports. I only work on ports *occasionally*, i'm not a > > real porter, yet i currently have the following amounts of space *in > > use* for work on ports: > > > > - /usr/local/ -- 9 GB (separate partition) > > - /usr/ports/pobj/ -- 18 GB (separate partition) > > - /usr/ports/distfiles/ -- 9 GB (partition /usr/ports/) > > - /usr/ports/packages/ -- 8 GB > > - /usr/ports/ -- 650 MB (rest of the partition) > > > > In addition to that, i have about 115 checkouts of source trees > > of various software that i occasionally work on or look at on > > another partition, which takes up another 21 GB (but that's more > > for base that for ports work). > > > > Yours, > > Ingo > > Other than using OpenBSD as general secure laptop env and doing some > development > I have planned to work on some ports, have done a little bit to try to help > with > lmms for example. > > At the time I installed this system (the 128 GB SSD is what came with it) I > probably didn't know enough about wxallowed to properly make decisions. > > Probably the smartest thing to do is maybe reinstall or at least redo the > partitions a good bit. I think what I need to do is make /usr smaller make > /usr/local a good 15gb partition and the rest leave for /usr/ports. I think I > need to backup what I got and then drop those partitions/disklabels and remake > them. That is probably the cleanest, I am guessing it will be best to do that > from single user mode. > > Ken > This obviously isn't the officially recommended way to do it, but it works here. I put everything in my $HOME and use symlinks to trick the build system into thinking it's in /usr/ports, etc. Thus, no need to fool with partitions. Edgar
Re: resize /usr
On Mon, Sep 03, 2018 at 03:59:07AM +0200, Ingo Schwarze wrote: > Hi Ken, > > How exactly to distribute space among partitions really depends on what > you want to use the machine for. The disk you are showing above can be > called terribly small nowadays (though i admit that i used disks in > production with OpenBSD 2.7 17 years ago that were more than 1000 > times smaller), so small that you are likely to run out of space > sooner or later even if you don't let waste data lying around. > > Yes, you always want /usr/local/, except maybe on a pure firewall router > where you are not planning to install any ports whatsoever except rsync. > > I see you do not have /usr/src/, /usr/obj/, /usr/xenocara/, > and /usr/xobj/, so you are obviously not planning to work on patches > to the base system or to X11. Nothing is wrong with that. If you ever > start doing such work on that machine, you will have to bite off the > required partitions from home, though. It would have been smarter if > you had left at least 10G at the end of the disk unallocated; if you > ever needed some partition like that, you could create it without a fuss; > if /home/ ever got full, you could move some stuff there. > > I see you do have /usr/ports/, so obviously, you are planning to do > some work on ports. I only work on ports *occasionally*, i'm not a > real porter, yet i currently have the following amounts of space *in > use* for work on ports: > > - /usr/local/-- 9 GB (separate partition) > - /usr/ports/pobj/ -- 18 GB (separate partition) > - /usr/ports/distfiles/ -- 9 GB (partition /usr/ports/) > - /usr/ports/packages/ -- 8 GB > - /usr/ports/-- 650 MB (rest of the partition) > > In addition to that, i have about 115 checkouts of source trees > of various software that i occasionally work on or look at on > another partition, which takes up another 21 GB (but that's more > for base that for ports work). > > Yours, > Ingo Other than using OpenBSD as general secure laptop env and doing some development I have planned to work on some ports, have done a little bit to try to help with lmms for example. At the time I installed this system (the 128 GB SSD is what came with it) I probably didn't know enough about wxallowed to properly make decisions. Probably the smartest thing to do is maybe reinstall or at least redo the partitions a good bit. I think what I need to do is make /usr smaller make /usr/local a good 15gb partition and the rest leave for /usr/ports. I think I need to backup what I got and then drop those partitions/disklabels and remake them. That is probably the cleanest, I am guessing it will be best to do that from single user mode. Ken
Re: resize /usr
Hi Ken, Ken M wrote on Sun, Sep 02, 2018 at 03:47:05PM -0400: > 16 partitions: > #size offset fstype [fsize bsize cpg] > a: 2097152 64 4.2BSD 2048 16384 12958 # / > b: 8241536 2097216swap# none > c:2500696800 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:134126688115941088 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. How exactly to distribute space among partitions really depends on what you want to use the machine for. The disk you are showing above can be called terribly small nowadays (though i admit that i used disks in production with OpenBSD 2.7 17 years ago that were more than 1000 times smaller), so small that you are likely to run out of space sooner or later even if you don't let waste data lying around. Yes, you always want /usr/local/, except maybe on a pure firewall router where you are not planning to install any ports whatsoever except rsync. I see you do not have /usr/src/, /usr/obj/, /usr/xenocara/, and /usr/xobj/, so you are obviously not planning to work on patches to the base system or to X11. Nothing is wrong with that. If you ever start doing such work on that machine, you will have to bite off the required partitions from home, though. It would have been smarter if you had left at least 10G at the end of the disk unallocated; if you ever needed some partition like that, you could create it without a fuss; if /home/ ever got full, you could move some stuff there. I see you do have /usr/ports/, so obviously, you are planning to do some work on ports. I only work on ports *occasionally*, i'm not a real porter, yet i currently have the following amounts of space *in use* for work on ports: - /usr/local/-- 9 GB (separate partition) - /usr/ports/pobj/ -- 18 GB (separate partition) - /usr/ports/distfiles/ -- 9 GB (partition /usr/ports/) - /usr/ports/packages/ -- 8 GB - /usr/ports/-- 650 MB (rest of the partition) In addition to that, i have about 115 checkouts of source trees of various software that i occasionally work on or look at on another partition, which takes up another 21 GB (but that's more for base that for ports work). Yours, Ingo
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 +, 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 2097216swap# none c:2500696800 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:134126688115941088 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
Re: resize /usr
On Sun, Sep 02, 2018 at 04:16:57PM +, Ken M wrote: > OK so now that I have been saved from my stupidity, let's try to prevent more > stupidity. > > $ df -h > Filesystem SizeUsed Avail Capacity Mounted on > /dev/sd0a 1005M245M710M26%/ > /dev/sd0h 62.9G 21.7G 38.1G36%/home > /dev/sd0d 3.9G302K3.7G 0%/tmp > /dev/sd0f 14.8G 11.6G2.5G82%/usr > /dev/sd0g 19.7G1.1G 17.6G 6%/usr/ports > /dev/sd0e 11.2G 56.1M 10.6G 1%/var > > Above is my current disk setup, what I would like to do is shrink /usr/ports > to > grow /usr. > > So from what I get growfs will work if I have space after /usr. So can I > shrink > /usr/ports and move it back so there is space after /usr or do I need to > completely drop and recreate /usr/ports? > 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
resize /usr
OK so now that I have been saved from my stupidity, let's try to prevent more stupidity. $ df -h Filesystem SizeUsed Avail Capacity Mounted on /dev/sd0a 1005M245M710M26%/ /dev/sd0h 62.9G 21.7G 38.1G36%/home /dev/sd0d 3.9G302K3.7G 0%/tmp /dev/sd0f 14.8G 11.6G2.5G82%/usr /dev/sd0g 19.7G1.1G 17.6G 6%/usr/ports /dev/sd0e 11.2G 56.1M 10.6G 1%/var Above is my current disk setup, what I would like to do is shrink /usr/ports to grow /usr. So from what I get growfs will work if I have space after /usr. So can I shrink /usr/ports and move it back so there is space after /usr or do I need to completely drop and recreate /usr/ports? Ken
Resize /usr with disklabel - Maximum size
I have OpenBSD4.9 running on a VPS, and i want to reduce the size of /home partition, and increase the size of /usr. After reduce the size of /home, disklabel says: --- OpenBSD area: 64-20964825; size: 10236.7M; free: 2000.3M But, when i try edit /usr partition to add the 2G free space to it, disklabel says: --- Partition f is currently 2185664 sectors in size, and can have a maximum size of 2185664 sectors. Can you give me some hints? Thank you. -- []s Erick
Re: Resize /usr with disklabel - Maximum size
Erick Andrade wrote: I have OpenBSD4.9 running on a VPS, and i want to reduce the size of /home partition, and increase the size of /usr. After reduce the size of /home, disklabel says: --- OpenBSD area: 64-20964825; size: 10236.7M; free: 2000.3M But, when i try edit /usr partition to add the 2G free space to it, disklabel says: --- Partition f is currently 2185664 sectors in size, and can have a maximum size of 2185664 sectors. You can't reduce the size of a ffs (filesystem), /home here. Unless you destroy it and then re-create it. And I can't think of an easy way (if any) to move the beginning of an existing ffs system (that's what I think you want to do with here with /usr). What you can do is use the space freed after re-creating the /home label / fs to create another label/fs that could hold, for example, /usr/src. If I were you, I'd just do backups (you got backups already, right?) and reinstall properly.
Re: Resize /usr with disklabel - Maximum size
Thank you, Jeremie. Erick 2011/10/25 Jeremie Courreges-Anglas ktulu+o...@wxcvbn.org: Erick Andrade wrote: I have OpenBSD4.9 running on a VPS, and i want to reduce the size of /home partition, and increase the size of /usr. After reduce the size of /home, disklabel says: --- OpenBSD area: 64-20964825; size: 10236.7M; free: 2000.3M But, when i try edit /usr partition to add the 2G free space to it, disklabel says: --- Partition f is currently 2185664 sectors in size, and can have a maximum size of 2185664 sectors. You can't reduce the size of a ffs (filesystem), /home here. Unless you destroy it and then re-create it. And I can't think of an easy way (if any) to move the beginning of an existing ffs system (that's what I think you want to do with here with /usr). What you can do is use the space freed after re-creating the /home label / fs to create another label/fs that could hold, for example, /usr/src. If I were you, I'd just do backups (you got backups already, right?) and reinstall properly. -- []s Erick