[arch-general] Mounting root according to fstab the first time (fstab in initrd)?

Devon Smith devo8604 at gmail.com
Wed Jan 20 20:56:52 UTC 2016


You shouldn't have to change grub config at all unless you would like
to remove that required root flag. You do not need to add all of your
mount options as root flags since the remount service will read your
fstab and mount the fs accordingly. This instance, where a mount
option cannot be applied during a remount, is the only reason I can
think of (and also barring any other special
circumstances/configurations) that you would need to specify a mount
option as a boot parameter.

Devon

On Wed, Jan 20, 2016 at 1:48 PM, Garmine 42 <mikro001 at gmail.com> wrote:
> I would like to avoid modifying rootflags inside grub config so if I
> change anything in fstab I don't have to change that in other places
> as well. Unless grub-mkconfig can somehow be taught to parse fstab and
> set the rootflags according to it.
>
> On 20 January 2016 at 21:43, Devon Smith <devo8604 at gmail.com> wrote:
>> Garmine,
>>     If you are using grub2 you should be able to add that option in
>> your grub config, then regenerate it, that will make that option
>> permanent and you wont have to add it every time at boot. Also, if
>> 'ro' is in your kernel params at boot, then im pretty sure masking the
>> remount service will ensure that your root remains mounted ro...
>>
>> Devon
>>
>> On Wed, Jan 20, 2016 at 1:34 PM, Garmine 42 <mikro001 at gmail.com> wrote:
>>> On 20 January 2016 at 21:18, Leonid Isaev
>>> <leonid.isaev at jila.colorado.edu> wrote:
>>>> On Wed, Jan 20, 2016 at 09:01:22PM +0100, Garmine 42 wrote:
>>>>> There was a discussion on the linux-btrfs mailing list about this, and
>>>>> for example the btrfs space_cache option can not be changed with a
>>>>> remount - this causes the fstab file's space_cache option to be
>>>>> basically ignored. I want to eliminate this kind of issue on my setup,
>>>>> that's why I need to avoid root being remounted. Instead I want root
>>>>> to be mounted with the options specified in fstab the first (and only)
>>>>> time.
>>>>
>>>> Why is it ignored?
>>>> /dev/sda4 on / type btrfs (ro,nodev,relatime,compress=zlib,ssd,space_cache,autodefrag,subvolid=257,subvol=/_root)
>>>>                                                                ^^^^^^^^^^^
>>>
>>> The linux-btrfs discussion suggests that some mount options might be
>>> unchanged after a remount even if it should change based on the fstab.
>>>
>>> Although that particular discussion's exact problem was something else
>>> in my opinion, so they might be wrong on that. The fix for that
>>> problem was including the problematic option (space_cache=v2) in the
>>> rootflags parameter. Considering the cmdline size is limited and I
>>> want to avoid modifying that all the time, I want to mount the root
>>> volume with the correct flags in the first place.
>>>
>>>> Also, there is fstab in the initramfs:
>>>> $ lsinitcpio /boot/initramfs-linux.img | grep fstab
>>>> etc/fstab
>>>
>>> That fstab is an empty file (ran in an uncompreseed initrd):
>>> % wc -c etc/fstab
>>> 0 etc/fstab
>>>
>>>> Have you tried masking the systemd-remount-fs.service?
>>>
>>> First I will try to exclude root= and rootflags= parameters from the
>>> cmdline and include the fstab via mkinitcpio and see if it finds the
>>> root. Do I want to mask remount-fs in this case?
>>>
>>>> Cheers,
>>>> --
>>>> Leonid Isaev
>>>> GPG fingerprints: DA92 034D B4A8 EC51 7EA6  20DF 9291 EE8A 043C B8C4
>>>>                   C0DF 20D0 C075 C3F1 E1BE  775A A7AE F6CB 164B 5A6D


More information about the arch-general mailing list