Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Dec 2022 15:44:27 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        "karels@freebsd.org" <karels@FreeBSD.org>, dev-commits-src-main@freebsd.org
Subject:   Re: git: d670a8f7c596 - main - growfs_fstab: add new /etc/rc.d script to add swap to fstab
Message-ID:  <AE1C9724-9315-4666-8B89-FA0EF160D636@yahoo.com>
In-Reply-To: <3F68EC4A-1D8A-409B-81D0-BECE377EFBE7@yahoo.com>
References:  <3F68EC4A-1D8A-409B-81D0-BECE377EFBE7@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 25, 2022, at 14:41, Mark Millard <marklmi@yahoo.com> wrote:

> Mike Karels <karels_at_FreeBSD.org> wrote on
> Date: Sat, 10 Dec 2022 19:41:14 UTC :
>=20
>> The branch main has been updated by karels:
>>=20
>> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3Dd670a8f7c596fd387823644c5cbf1dde=
e788eee4
>>=20
>> commit d670a8f7c596fd387823644c5cbf1ddee788eee4
>> Author: Mike Karels <karels@FreeBSD.org>
>> AuthorDate: 2022-12-10 19:39:59 +0000
>> Commit: Mike Karels <karels@FreeBSD.org>
>> CommitDate: 2022-12-10 19:39:59 +0000
>>=20
>> growfs_fstab: add new /etc/rc.d script to add swap to fstab
>>=20
>> The growfs_fstab script is a helper for the growfs script to add any
>> new swap partition to /etc/fstab on first boot. If growfs adds a
>> swap partition, it sets growfs_swap_pdev in the kenv. In this case,
>> after the root file system is read/write, if there is no swap =
partition
>> in the fstab, growfs_fstab adds growfs_swap as a swap partition to =
the
>> fstab. Also, it runs dumpon to add the swap partition (as this
>> happened earlier in the startup sequence).
>>=20
>> Discussed with: cperciva
>> Differential Revision: https://reviews.freebsd.org/D37463
>> . . .
>=20
> I tried the new main [so: 14] snapshot, dd'd to a USB3 SSD and booted:
>=20
> snaphot: =
FreeBSD-14.0-CURRENT-arm64-aarch64-RPI-20221224-c89209c674f2-259842.img
> so: FreeBSD 14.0-CURRENT #0 main-n259842-c89209c674f2: Sat Dec 24 =
05:52:28 UTC 2022
>=20
> Result (from the serial console capture):
>=20
> Starting file system checks:
> /dev/ufs/rootfs: FILE SYSTEM CLEAN; SKIPPING CHECKS
> /dev/ufs/rootfs: clean, 599506 free (242 frags, 74908 blocks, 0.0% =
fragmentation)
> /etc/rc.d/growfs: 203: Syntax error: "(" unexpected (expecting "}")
>=20
>=20
> Looks to be the ' in "Don't" in a supposed #comment that that instead =
matches a prior awk use of ' unintentionally. Later in the line is: =
"(decimal)" that supplies the "(" reported.
>=20

To test more, I redid the dd and then replaced the problematical
"Don't" with "Do not". (FYI: I shorten shell prompts in messages.)

# gpart show
=3D>       63  468862065  da0  MBR  (224G)
         63       1985       - free -  (993K)
       2048     102400    1  fat32lba  [active]  (50M)
     104448  468757680    2  freebsd  (224G)

=3D>        0  468757680  da0s2  BSD  (224G)
          0        128         - free -  (64K)
        128  451979136      1  freebsd-ufs  (216G)
  451979264   16777216      2  freebsd-swap  (8.0G)
  468756480       1200         - free -  (600K)

But:

# swapinfo
Device          1K-blocks     Used    Avail Capacity

So: no use of the swap was set up by default.

# more /etc/fstab
# Custom /etc/fstab for FreeBSD embedded images
/dev/ufs/rootfs         /               ufs     rw              1       =
1
/dev/msdosfs/EFI                /boot/efi       msdosfs rw,noatime      =
0       0
tmpfs                   /tmp            tmpfs   rw,mode=3D1777    0      =
 0

Nor did it appear that dumping was set up to use the swap.

For reference:

# ls -Tld /etc/rc.d/growfs*
-r-xr-xr-x  1 root  wheel  8133 Dec 25 22:47:48 2022 /etc/rc.d/growfs

(So, no growfs_fstab script there.)

However, there was an error message not tied to growfs that
might indicate that some later processing was not done(?):

. . .
Starting devd.
genet0: link state changed to UP
sh: /usr/libexec/hyperv/hyperv_vfattach: not found
Starting dhclient.
. . .


I'll note:

# ls -Tld /dev/label/*
crw-r-----  1 root  operator  0x66 Dec 25 22:47:55 2022 =
/dev/label/growfs_swap

# swapon /dev/label/growfs_swap
# swapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/label/growfs_swap   8388604        0  8388604     0%

So the label is in place for use.


=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AE1C9724-9315-4666-8B89-FA0EF160D636>