[PATCH v2] mkdumprd: try to get mount options from fstab first

Vivek Goyal vgoyal at redhat.com
Wed Sep 17 12:49:27 UTC 2014


On Wed, Sep 17, 2014 at 06:46:49PM +0800, Baoquan He wrote:
> On 09/16/14 at 09:08am, Vivek Goyal wrote:
> > On Tue, Sep 16, 2014 at 03:06:25PM +0800, Baoquan He wrote:
>  > > > @@ -104,7 +104,8 @@ to_mount() {
> > > > >      # mount under /sysroot in 2nd kernel, and we umount -R /sysroot before exit
> > > > >      _target="/sysroot$_target"
> > > > >      _fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev)
> > > > > -    _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
> > > > > +    _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev)
> > > > > +    [ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
> > > > 
> > > > Ok, so kernel recognizes -o defaults?
> > > > 
> > > > Secondly, question of x-systemd.* options still remains.
> > > 
> > > I just put the information of fstab in 1st kernel into fstab in 2nd
> > > kernel. They should handle fstab in the same mechanism. I just tested
> > > the -o defaults, it works. There should not be difference between 1st
> > > kernel and 2nd kernel.
> > 
> > what about x-systemd* options?
> > 
> > I think dracut puts them into fstab files and respective mount units
> > are created and that's why we don't see the failure.
> > 
> > Otherwise I got a feeling that if you pass x-systemd* directly to mount
> > command, it might fail.
> 
> I checked systemd.mount manpage, it's saying that mount units may be
> configured via unit files or /etc/fstab, and /etc/fstab is preferred.
> Meanwhile if x-systemd.xxx is specified in systemd.mount files, it will
> specify the specific behavior of systemd. That means x-systemd.xxx is
> options for systemd.mount, not for /etc/fstab. So if get entry from
> /etc/fstab via "findmnt --fstab xxx" command, no worry needed for
> x-systemd.xxx. And x-systemd.xxx is not options of fstab, no need to
> filter them.

Bao,

Yes x-systemd* are options for systemd. But they can be specified in
/etc/fstab file. Only my system they are present.

So question is, who removes these options from command line when actual
"mount" is called.

Thanks
Vivek


More information about the kexec mailing list