Mounting swap device on iscsi target

Eugene Grosbein eugen at grosbein.net
Mon Jan 18 13:02:27 UTC 2021


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.



More information about the freebsd-hackers mailing list