Re: ports default location /usr/ports and partition sizing

2020-12-13 Thread Chris Bennett
Others will have better advice for sizes. I kinda guess.
I put everthing except /usr/ports from the tar in it's own partition.
pobj, packages, distfiles, etc. put into /etc/mk.conf
man bsd.ports.mk shows how to put that there.

I also put /usr/ports/mystuff in it's own partition.
That allows me to umount it, newfs /uar/ports, download ports.tar.gz,
untar it, mkdir /usr/ports/mystuff, mount that and chown -R all the
directories from a script.


#!/bin/sh

cd /home/6.8current_ports;
rm ports.tar.gz;

wget https://ftp.openbsd.org/pub/OpenBSD/snapshots/ports.tar.gz; 

# umount, newfs, fsck, remount, tar to ports 
umount /dev/sd0o && umount /dev/sd0i && newfs /dev/rsd0i && fsck -fp /dev/sd0i 
&& mount -o rw,nodev,nosuid /dev/sd0i /usr/ports && mkdir /usr/ports/mystuff && 
echo 'newfs fsck Success!'
mount -o rw,nodev,nosuid /dev/sd0o /usr/ports/mystuff && echo 'mount mystuff 
Success';
cd /usr/ && tar xzf /home/6.8current_ports/ports.tar.gz && echo 'untarred 
Success!'
cd /usr/ && chown -R sways:sways ports packages distfiles Pobj

Hopefully that's helpful. I run the script right after every sysupgrade
to a new snapshot.

Chris Bennett




Re: ports default location /usr/ports and partition sizing

2020-12-13 Thread Landry Breuil
On Sun, Dec 13, 2020 at 08:48:38AM +, Mikolaj Kucharski wrote:
> Hi,
> 
> This is a quote from Stuart Henderson  from couple of
> months ago:
> 
> > I would really recommend people just make a partition for /usr/ports and
> > save the hassle and potential problems of moving it elsewhere via
> > environment/ mk.conf/attempts with symlinks...
> 
> He mentions that kind of sentiment few times on the mailing list. When I
> look at couple of my machines which do have ports checked out, they're
> never in default /usr/ports location.
> 
> I wanted to finally have at least one machine with default location and
> then ralized, no good quide what size to assign to the partition. Should
> that be just part of /usr partition? I'm not sure, does the installer or
> actually disklabel and its automatic disk allocation takes ports
> development into account with sizing? What are your setups? Are
> you having /usr/ports on /usr partition or do you create separate
> partition for /usr/ports? What would be its size?

the automatic disk allocation doesnt take ports developement into
account.

> I've glanced at main Porter's Handbook page[1] and didn't find
> anything about disk slicing and disk requirements.
> 
> I've looked at FAQ's Disk Partitioning[2], hier(7) and ports(7), but I
> don't see any info about partition allocation and sizing. I think from
> my perspective that lack of information is main contributor, why I
> don't use default location for ports.

Well, from experience, /usr/ports itself doesnt matter much, but:

- /usr/obj/ports (or ${PORTSDIR}/pobj the default, which i never
personally used) needs sizing depending on what you build (a full build
of firefox with debug symbols takes ~10G iirc, probably same for webkit
and more for chromium)

- /usr/ports/distfiles needs sizing depending on what you build too
  (350Mb per mozilla distfile), and needs pruning from time to time (i
tend to prune /usr/ports/mozilla which often gets gigabyte-sized with
many beta tarballs)

- /usr/ports/packages also needs sizing depending on what you build and
  if you build stuff with debug syms. Also needs pruning from time to
time (and dont forget to prune under packages/${arch}/*, not only
packages/${arch}/all, otherwise you dont regain disk space)

afte after that, maybe only /usr/ports/plist tend to accumulate files
over time, but that's only text files.

if you want to run bulks, at least 100Gb for both packages and distfiles
is required.

/dev/sd0e 149G   88.9G   52.5G63%/usr/ports

68.1G   /usr/ports/distfiles

is what i have on an old cluster bulk builder that i havent updated nor
cleaned in a while.

on my build vm that i use daily (mostly for mozilla builds but other
stuff too) i have ports under /home, and the given disk usage:

/dev/sd0i 27.3G   24.6G1.3G95%/home
/dev/sd0h 29.5G5.5G   22.6G20%/usr/obj

/usr/obj/ports/.ccache is limited to 8G, and im often limited by
distfiles or packages or objdir being full, but i tend to let old
distfiles and packages accumulate.

For a new machine where disk space doesnt matter much, i'd say
a 100Gb /usr/ports is comfortable. separate objdir can be helpful if
disk can be slow and its faster to newfs rather than rm'ing files.

Landry



ports default location /usr/ports and partition sizing

2020-12-13 Thread Mikolaj Kucharski
Hi,

This is a quote from Stuart Henderson  from couple of
months ago:

> I would really recommend people just make a partition for /usr/ports and
> save the hassle and potential problems of moving it elsewhere via
> environment/ mk.conf/attempts with symlinks...

He mentions that kind of sentiment few times on the mailing list. When I
look at couple of my machines which do have ports checked out, they're
never in default /usr/ports location.

I wanted to finally have at least one machine with default location and
then ralized, no good quide what size to assign to the partition. Should
that be just part of /usr partition? I'm not sure, does the installer or
actually disklabel and its automatic disk allocation takes ports
development into account with sizing? What are your setups? Are
you having /usr/ports on /usr partition or do you create separate
partition for /usr/ports? What would be its size?

I've glanced at main Porter's Handbook page[1] and didn't find
anything about disk slicing and disk requirements.

I've looked at FAQ's Disk Partitioning[2], hier(7) and ports(7), but I
don't see any info about partition allocation and sizing. I think from
my perspective that lack of information is main contributor, why I
don't use default location for ports.

[1] https://www.openbsd.org/faq/ports/index.html
[2] https://www.openbsd.org/faq/faq4.html#Partitioning

-- 
Regards,
 Mikolaj