nspawn/mkosi-definitions

Add a standard --root-size value (maybe 2GB?) to all mkosi default files

q2dg opened this issue ยท 4 comments

q2dg commented

Current images have no space left to add any content to them (like installing one more package, for instance). Maybe a bit more of free space by default would be a great idea to make images more usable.
Thanks!

Hi @q2dg sorry for the late reply,
Yes, this makes absolutely sense, I just wonder if this would increase the tarball size as well.

Hello, I've checked the ArchLinux raw image today and I can't reproduce this issue as all raw images are created with a 2.9G root size by default. When I import and boot the image, I got:

archlinux login: root
Password: 
Last login: Tue Mar  2 03:09:29 on pts/0
[root@archlinux ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0p2    2.9G  732M  2.1G  27% /
/dev/loop0p1    253M   39M  214M  16% /efi
tmpfs           3.2G     0  3.2G   0% /tmp
tmpfs           4.0M     0  4.0M   0% /dev
tmpfs           3.2G     0  3.2G   0% /dev/shm
tmpfs           6.3G   64K  6.3G   1% /run
/dev/nvme0n1p5   98G   22G   72G  24% /run/host/os-release
run              16G  1.4M   16G   1% /run/host/incoming
tmpfs           3.2G     0  3.2G   0% /run/user/0

and I can also install packages as well:

[root@archlinux ~]# pacman -Syu pacman-contrib
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (5) db-5.3.28-5  fakeroot-1.25.3-2  gdbm-1.19-2  perl-5.32.1-1
             pacman-contrib-1.4.0-1

Total Download Size:   16.53 MiB
Total Installed Size:  64.90 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 fakeroot-1.25.3-...    70.7 KiB  1178 KiB/s 00:00 [######################] 100%
 gdbm-1.19-2-x86_64    210.7 KiB  2.29 MiB/s 00:00 [######################] 100%
 db-5.3.28-5-x86_64   1098.0 KiB  2.02 MiB/s 00:01 [######################] 100%
 perl-5.32.1-1-x86_64   15.1 MiB  3.70 MiB/s 00:04 [######################] 100%
 pacman-contrib-1...    37.7 KiB  3.68 MiB/s 00:00 [######################] 100%
(5/5) checking keys in keyring                     [######################] 100%
(5/5) checking package integrity                   [######################] 100%
(5/5) loading package files                        [######################] 100%
(5/5) checking for file conflicts                  [######################] 100%
(5/5) checking available disk space                [######################] 100%
:: Processing package changes...
(1/5) installing fakeroot                          [######################] 100%
(2/5) installing gdbm                              [######################] 100%
(3/5) installing db                                [######################] 100%
(4/5) installing perl                              [######################] 100%
(5/5) installing pacman-contrib                    [######################] 100%
Optional dependencies for pacman-contrib
    findutils: for pacdiff --find [installed]
    mlocate: for pacdiff --locate
    sudo: privilege elevation for several scripts
    vim: default merge program for pacdiff
:: Running post-transaction hooks...
(1/3) Reloading system manager configuration...
(2/3) Arming ConditionNeedsUpdate...
(3/3) Warn about old perl modules
[root@archlinux ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0p2    2.9G  820M  2.0G  30% /
/dev/loop0p1    253M   39M  214M  16% /efi
tmpfs           3.2G     0  3.2G   0% /tmp
tmpfs           4.0M     0  4.0M   0% /dev
tmpfs           3.2G     0  3.2G   0% /dev/shm
tmpfs           6.3G   64K  6.3G   1% /run
/dev/nvme0n1p5   98G   22G   72G  24% /run/host/os-release
run              16G  1.4M   16G   1% /run/host/incoming
tmpfs           3.2G     0  3.2G   0% /run/user/0

same with Debian:

Debian GNU/Linux 10 buster console

buster login: root
Password: 
Linux buster 5.11.2-128-tkg-MuQSS #1 TKG SMP PREEMPT Sun, 28 Feb 2021 17:05:15 +0000 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@buster:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0p1    2.9G  200M  2.6G   8% /
tmpfs           3.2G     0  3.2G   0% /tmp
tmpfs           4.0M     0  4.0M   0% /dev
tmpfs           3.2G     0  3.2G   0% /dev/shm
tmpfs           6.3G   68K  6.3G   1% /run
/dev/nvme0n1p5   98G   22G   72G  24% /run/host/os-release
run              16G  1.4M   16G   1% /run/host/incoming
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.2G     0  3.2G   0% /run/user/0

@shibumi can you confirm if what I just wrote is what the issue was referring to?

Looks like I fixed this already and just forgot to close the issue.

The plan for the future is to have systemd automatically enlarge the image. Systemd is capable to do this.

This was fixed in systemd/mkosi#462