Re: [PATCH] fstab: do not mount and fsck from fstab if using systemd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/01/14 at 11:06am, Alexander Tsoy wrote:
> On Tue Apr   1 09:19:13 2014 WANG Chao <chaowang@xxxxxxxxxx> wrote:
> > If using systemd in initramfs, we could run into a race condition when
> > dracut and systemd both are trying to mount and run fsck for the same
> > filesystem, and mount or fsck could be a failure.
> > 
> > To fix such failure, we should use systemd to mount/fsck from /etc/fstab
> > only.
> > 
> > Signed-off-by: WANG Chao <chaowang@xxxxxxxxxx>
> > ---
> >   modules.d/95fstab-sys/mount-sys.sh | 6 +++++-
> >   1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/modules.d/95fstab-sys/mount-sys.sh
> > b/modules.d/95fstab-sys/mount-sys.sh index 12711a0..d65cafd 100755
> > --- a/modules.d/95fstab-sys/mount-sys.sh
> > +++ b/modules.d/95fstab-sys/mount-sys.sh
> > @@ -27,7 +27,11 @@ fstab_mount() {
> >           return 0
> >   }
>
> > -[ -f /etc/fstab ] && fstab_mount /etc/fstab
> > +# systemd will mount and run fsck from /etc/fstab and we don't want to
> > +# run into a race condition.
> > +if [ `readlink -f /init` != '/usr/lib/systemd/systemd' ]; then
> 
> It's better to test DRACUT_SYSTEMD variable here:
> 
> if [ -z "$DRACUT_SYSTEMD" ]; then

Right. Will post v2. Thanks.

WANG Chao

> 
> > +       [ -f /etc/fstab ] && fstab_mount /etc/fstab
> > +fi
>
> >   # prefer $NEWROOT/etc/fstab.sys over local /etc/fstab.sys
> >   if [ -f $NEWROOT/etc/fstab.sys ]; then
> > -- 
> > 1.8.5.3
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe initramfs" in
> > the body of a message to majordomo@xxxxxxxxxxxxxxx
> > More majordomo info at   http://vger.kernel.org/majordomo-info.html
> 
> -- 
> Alexander Tsoy
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux