Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jan 2021 20:01:59 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        =?UTF-8?Q?BERTRAND_Jo=c3=abl?= <joel.bertrand@systella.fr>
Cc:        Freebsd hackers list <freebsd-hackers@freebsd.org>
Subject:   Re: Mounting swap device on iscsi target
Message-ID:  <b0b5af8c-9df7-5151-0d3f-378d9360f03f@grosbein.net>
In-Reply-To: <d5f7f4c9-2ecb-04c4-28aa-4d5675bcd97d@systella.fr>
References:  <fe95f085-b516-f431-9bfd-6c4f9b63e900@systella.fr> <6a015119-1bd9-20a7-54ce-8ca9cbaadc23@grosbein.net> <0b3cada6-eaea-89ce-0f89-edd1f1f8e7a3@systella.fr> <a1381846-4a35-4427-1d76-969e7407fde7@grosbein.net> <8ab80674-a54f-8720-93b9-8161a590c373@systella.fr> <a9224923-13ce-63b6-b463-6a1b077ec74a@grosbein.net> <d5f7f4c9-2ecb-04c4-28aa-4d5675bcd97d@systella.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
18.01.2021 15:36, BERTRAND Joël wrote:

>>>>> 	If I have understood, varmfs creates whole /var. I have some troubles
>>>>> with /var/at also. How can I create a file system in memory for /var/run
>>>>> and /var/at ?
>>>>
>>>> Read diskless(8) manual page, section CONFIGURATION.
>>>
>>> 	I don't understand your answer. I have configured this workstation a
>>> long time ago and I have read this manual page to write its
>>> configuration. My question was : how create two ramdisks, one for
>>> /var/at, the second for /var/run in /etc/rc.conf ? I suppose I can write
>>> a script in /etc/rc.d, but I'm pretty sure somebody use diskless FreeBSD
>>> workstation also.
>>
>> We have /etc/rc.initdiskless script that runs if there is (empty) /etc/diskless file at boot time.
>> In addition to diskless(8) manual page, please read comments at the beginning of /etc/rc.initdiskless,
>> they describe its mechanics in more details. In particular, it tells:
>>
>> # The existence of a directory /conf/T/M causes this script to create a
>> # memory filesystem mounted as /M on the client.
>>
>> So it is able to create as many in-memory file system as you need
>> once you provide diskless machine with correct /conf directory.
>>
>> Use that, it works.
> 
> 	I have read documentation and I have a simple question. If I create
> /conf/default/at, I understand this script will create a memory disk
> mounted in /at.
> 
> 	I want to create, for example, /var/at. If I understand,
> /conf/default/at.cpio.gz is required also.
> 
> 	But how can I mount this filesystem on /var/at ? Is
> /config/default/at/diskless_remount (that contains /var/at) enough ?

There are several options. You can follow an example in comments about "generic diskless fstab"
and just add single line for /var/at to /conf/default/etc/fstab,
it's handy if you are fine with empty file system.

Or you can create /at and have a symlink /var/at -> /at, it should work, too.
This way you will be able to populate the directory with template contents and/or template override.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b0b5af8c-9df7-5151-0d3f-378d9360f03f>