We are using dracut --mount to pass fstab lines for mounting filesystems other than rootfs. But we did not provide passno for filesystem checking.
Add passno '2' for all the --mount targets.
Tested in F19 guest.
Signed-off-by: Dave Young dyoung@redhat.com --- mkdumprd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- kexec-tools.orig/mkdumprd +++ kexec-tools/mkdumprd @@ -104,7 +104,7 @@ to_mount() { _o=$(findmnt -k -f -n -r -o OPTIONS $_dev) _o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel _o="${_o},nofail" #with nofail set, systemd won't block for mount failure - _mntopts="$_t $_o" + _mntopts="$_t $_o 0 2" #for non-nfs _dev converting to use udev persistent name if [ -b "$_s" ]; then _pdev="$(get_persistent_dev $_s)"
Hello Vivek
I only addressed the kdump part for --mount. There's already fsck code in dracut fstab-sys module, so we only need pass the passno in mkdumprd
For another issue as you mentioned for remount,rw for rootfs. fsck will refuse to continue if it's already mounted. It's always sugested to fsck before mounting unless using '-f'.
Chao has veryfied that latest RHEL7 has pulled in changes from upstream systemd that will add fsck functionality for rootfs in initramfs so we do not need worry about it.
On 02/12/14 at 03:22pm, Dave Young wrote:
We are using dracut --mount to pass fstab lines for mounting filesystems other than rootfs. But we did not provide passno for filesystem checking.
Add passno '2' for all the --mount targets.
Tested in F19 guest.
Signed-off-by: Dave Young dyoung@redhat.com
mkdumprd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- kexec-tools.orig/mkdumprd +++ kexec-tools/mkdumprd @@ -104,7 +104,7 @@ to_mount() { _o=$(findmnt -k -f -n -r -o OPTIONS $_dev) _o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel _o="${_o},nofail" #with nofail set, systemd won't block for mount failure
- _mntopts="$_t $_o"
- _mntopts="$_t $_o 0 2" #for non-nfs _dev converting to use udev persistent name if [ -b "$_s" ]; then _pdev="$(get_persistent_dev $_s)"
On Wed, Feb 12, 2014 at 03:38:10PM +0800, Dave Young wrote:
[..]
For another issue as you mentioned for remount,rw for rootfs. fsck will refuse to continue if it's already mounted. It's always sugested to fsck before mounting unless using '-f'.
Chao has veryfied that latest RHEL7 has pulled in changes from upstream systemd that will add fsck functionality for rootfs in initramfs so we do not need worry about it.
So are you saying that systemd now is running fsck on root filesystem in initramfs before monting it read only?
In last mails chao had mentioned that systemd does not run fsck on root filesystem in initramfs. So that has changed since then?
Thanks Vivek
On 02/13/14 at 10:13am, Vivek Goyal wrote:
On Wed, Feb 12, 2014 at 03:38:10PM +0800, Dave Young wrote:
[..]
For another issue as you mentioned for remount,rw for rootfs. fsck will refuse to continue if it's already mounted. It's always sugested to fsck before mounting unless using '-f'.
Chao has veryfied that latest RHEL7 has pulled in changes from upstream systemd that will add fsck functionality for rootfs in initramfs so we do not need worry about it.
So are you saying that systemd now is running fsck on root filesystem in initramfs before monting it read only?
In last mails chao had mentioned that systemd does not run fsck on root filesystem in initramfs. So that has changed since then?
Will leave this to Chao. Chao, could you help answer this question
Thanks Dave
On 02/14/14 at 10:41am, Dave Young wrote:
On 02/13/14 at 10:13am, Vivek Goyal wrote:
On Wed, Feb 12, 2014 at 03:38:10PM +0800, Dave Young wrote:
[..]
For another issue as you mentioned for remount,rw for rootfs. fsck will refuse to continue if it's already mounted. It's always sugested to fsck before mounting unless using '-f'.
Chao has veryfied that latest RHEL7 has pulled in changes from upstream systemd that will add fsck functionality for rootfs in initramfs so we do not need worry about it.
So are you saying that systemd now is running fsck on root filesystem in initramfs before monting it read only?
In last mails chao had mentioned that systemd does not run fsck on root filesystem in initramfs. So that has changed since then?
Will leave this to Chao. Chao, could you help answer this question
Running fsck on root fs in initrd is introduced in systemd-208. Currently RHEL7 is using systemd-207.
And then I find systemd-208 in our brew build: http://download.eng.bos.redhat.com/brewroot/packages/systemd/208/
It seems it's rebased v208, however I'm not sure when v208 will be pulled into RHEL-7.0 build.
This change is introduced in commit 7f5806d: # git describe 7f5806d7 v208-164-g7f5806d
commit 7f5806d Author: Thomas Bächler thomas@archlinux.org Date: Mon Sep 30 00:32:33 2013 +0200
fstab-generator: When parsing the root= cmdline option, set FsckPassNo to 1
[tomegun: without this we would never fsck the rootfs if it was directly mounted 'rw' from the initrd. We now risk fsck'ing it twice in the case it is mounted 'ro', so that should be addressed in a separate patch.]
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index 9e7d55d..a7536f8 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -442,7 +442,7 @@ static int parse_new_root_from_proc_cmdline(void) { }
log_debug("Found entry what=%s where=/sysroot type=%s", what, type); - r = add_mount(what, "/sysroot", type, opts, 0, noauto, nofail, false, + r = add_mount(what, "/sysroot", type, opts, 1, noauto, nofail, false, SPECIAL_INITRD_ROOT_FS_TARGET, "/proc/cmdline");
return (r < 0) ? r : 0;
On Fri, Feb 14, 2014 at 11:31:41AM +0800, WANG Chao wrote:
On 02/14/14 at 10:41am, Dave Young wrote:
On 02/13/14 at 10:13am, Vivek Goyal wrote:
On Wed, Feb 12, 2014 at 03:38:10PM +0800, Dave Young wrote:
[..]
For another issue as you mentioned for remount,rw for rootfs. fsck will refuse to continue if it's already mounted. It's always sugested to fsck before mounting unless using '-f'.
Chao has veryfied that latest RHEL7 has pulled in changes from upstream systemd that will add fsck functionality for rootfs in initramfs so we do not need worry about it.
So are you saying that systemd now is running fsck on root filesystem in initramfs before monting it read only?
In last mails chao had mentioned that systemd does not run fsck on root filesystem in initramfs. So that has changed since then?
Will leave this to Chao. Chao, could you help answer this question
Running fsck on root fs in initrd is introduced in systemd-208. Currently RHEL7 is using systemd-207.
Hi Chao,
This mailing list is for Fedora issues only and not RHEL7 issues. So let us keep RHEL7 specific discussions on respective mailing list.
I just want to make sure that in kdump environment we first run fsck on root before it is mounted rw to save dump in Fedora.
I looked at systemd f20 branch spec file and Version seems to be 208. So looks like we are good from Fedora perspective.
Thanks Vivek
On Wed, Feb 12, 2014 at 03:22:30PM +0800, Dave Young wrote:
We are using dracut --mount to pass fstab lines for mounting filesystems other than rootfs. But we did not provide passno for filesystem checking.
Add passno '2' for all the --mount targets.
Tested in F19 guest.
Signed-off-by: Dave Young dyoung@redhat.com
mkdumprd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- kexec-tools.orig/mkdumprd +++ kexec-tools/mkdumprd @@ -104,7 +104,7 @@ to_mount() { _o=$(findmnt -k -f -n -r -o OPTIONS $_dev) _o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel _o="${_o},nofail" #with nofail set, systemd won't block for mount failure
- _mntopts="$_t $_o"
- _mntopts="$_t $_o 0 2"
What is 0 here. I think you are trying to emulate the format of an fstab file and passing 5th and 6th field.
I don't think they are filesystem options. If you trying to mount a file system with 0 and 2 passed as additional parameters, mount will complain that what is 0 and 2 it does not understand.
I am CCing harald. He might have thoughts on what's the better way to pass the fsck_passno of filesystem being mounted. I would not mind of passno 2 is hardcoded for anything passed in using --mount option in dracut.
Thanks Vivek
On 02/13/2014 03:42 PM, Vivek Goyal wrote:
On Wed, Feb 12, 2014 at 03:22:30PM +0800, Dave Young wrote:
We are using dracut --mount to pass fstab lines for mounting filesystems other than rootfs. But we did not provide passno for filesystem checking.
Add passno '2' for all the --mount targets.
Tested in F19 guest.
Signed-off-by: Dave Young dyoung@redhat.com
mkdumprd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- kexec-tools.orig/mkdumprd +++ kexec-tools/mkdumprd @@ -104,7 +104,7 @@ to_mount() { _o=$(findmnt -k -f -n -r -o OPTIONS $_dev) _o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel _o="${_o},nofail" #with nofail set, systemd won't block for mount failure
- _mntopts="$_t $_o"
- _mntopts="$_t $_o 0 2"
What is 0 here. I think you are trying to emulate the format of an fstab file and passing 5th and 6th field.
I don't think they are filesystem options. If you trying to mount a file system with 0 and 2 passed as additional parameters, mount will complain that what is 0 and 2 it does not understand.
yes, kind of... as it is now, it would generate an invalid fstab line
while pop fstab_lines line; do printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" done
but most of the tools would accept that and the fsck would be done
I am CCing harald. He might have thoughts on what's the better way to pass the fsck_passno of filesystem being mounted. I would not mind of passno 2 is hardcoded for anything passed in using --mount option in dracut.
we can also check if those are present, and set "0 0" as the default if nothing is given in "--mount"
Thanks Vivek
On Thu, Feb 13, 2014 at 03:50:24PM +0100, Harald Hoyer wrote:
On 02/13/2014 03:42 PM, Vivek Goyal wrote:
On Wed, Feb 12, 2014 at 03:22:30PM +0800, Dave Young wrote:
We are using dracut --mount to pass fstab lines for mounting filesystems other than rootfs. But we did not provide passno for filesystem checking.
Add passno '2' for all the --mount targets.
Tested in F19 guest.
Signed-off-by: Dave Young dyoung@redhat.com
mkdumprd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- kexec-tools.orig/mkdumprd +++ kexec-tools/mkdumprd @@ -104,7 +104,7 @@ to_mount() { _o=$(findmnt -k -f -n -r -o OPTIONS $_dev) _o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel _o="${_o},nofail" #with nofail set, systemd won't block for mount failure
- _mntopts="$_t $_o"
- _mntopts="$_t $_o 0 2"
What is 0 here. I think you are trying to emulate the format of an fstab file and passing 5th and 6th field.
I don't think they are filesystem options. If you trying to mount a file system with 0 and 2 passed as additional parameters, mount will complain that what is 0 and 2 it does not understand.
yes, kind of... as it is now, it would generate an invalid fstab line
while pop fstab_lines line; do printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" done
but most of the tools would accept that and the fsck would be done
I am CCing harald. He might have thoughts on what's the better way to pass the fsck_passno of filesystem being mounted. I would not mind of passno 2 is hardcoded for anything passed in using --mount option in dracut.
we can also check if those are present, and set "0 0" as the default if nothing is given in "--mount"
Ok, so you don't mind being passed in fs_freq and fs_passno as last fields of --mount option.
In that case, Dave can you please also post a patch to modify dracut to parse these fields and use default of "0 0" only if use did not pass those.
Also please modify dracut man page and mention that one can pass in fs_freq and fs_passno as last options.
Dave, in the changelog of this patch, can we also please mention that why we need to set passno explicitly. We can mention that default is zero and that means no fsck will be run. But we want to make sure fsck is run before we try to save dump on filesystem.
Thanks Vivek
On 02/13/14 at 10:08am, Vivek Goyal wrote:
On Thu, Feb 13, 2014 at 03:50:24PM +0100, Harald Hoyer wrote:
On 02/13/2014 03:42 PM, Vivek Goyal wrote:
On Wed, Feb 12, 2014 at 03:22:30PM +0800, Dave Young wrote:
We are using dracut --mount to pass fstab lines for mounting filesystems other than rootfs. But we did not provide passno for filesystem checking.
Add passno '2' for all the --mount targets.
Tested in F19 guest.
Signed-off-by: Dave Young dyoung@redhat.com
mkdumprd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- kexec-tools.orig/mkdumprd +++ kexec-tools/mkdumprd @@ -104,7 +104,7 @@ to_mount() { _o=$(findmnt -k -f -n -r -o OPTIONS $_dev) _o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel _o="${_o},nofail" #with nofail set, systemd won't block for mount failure
- _mntopts="$_t $_o"
- _mntopts="$_t $_o 0 2"
What is 0 here. I think you are trying to emulate the format of an fstab file and passing 5th and 6th field.
I don't think they are filesystem options. If you trying to mount a file system with 0 and 2 passed as additional parameters, mount will complain that what is 0 and 2 it does not understand.
yes, kind of... as it is now, it would generate an invalid fstab line
while pop fstab_lines line; do printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" done
but most of the tools would accept that and the fsck would be done
I am CCing harald. He might have thoughts on what's the better way to pass the fsck_passno of filesystem being mounted. I would not mind of passno 2 is hardcoded for anything passed in using --mount option in dracut.
we can also check if those are present, and set "0 0" as the default if nothing is given in "--mount"
Ok, so you don't mind being passed in fs_freq and fs_passno as last fields of --mount option.
In that case, Dave can you please also post a patch to modify dracut to parse these fields and use default of "0 0" only if use did not pass those.
Sure, will do
Also please modify dracut man page and mention that one can pass in fs_freq and fs_passno as last options.
Ok.
Dave, in the changelog of this patch, can we also please mention that why we need to set passno explicitly. We can mention that default is zero and that means no fsck will be run. But we want to make sure fsck is run before we try to save dump on filesystem.
Ok, will do
Thanks Dave
On 02/14/14 at 10:40am, Dave Young wrote:
On 02/13/14 at 10:08am, Vivek Goyal wrote:
On Thu, Feb 13, 2014 at 03:50:24PM +0100, Harald Hoyer wrote:
On 02/13/2014 03:42 PM, Vivek Goyal wrote:
On Wed, Feb 12, 2014 at 03:22:30PM +0800, Dave Young wrote:
We are using dracut --mount to pass fstab lines for mounting filesystems other than rootfs. But we did not provide passno for filesystem checking.
Add passno '2' for all the --mount targets.
Tested in F19 guest.
Signed-off-by: Dave Young dyoung@redhat.com
mkdumprd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- kexec-tools.orig/mkdumprd +++ kexec-tools/mkdumprd @@ -104,7 +104,7 @@ to_mount() { _o=$(findmnt -k -f -n -r -o OPTIONS $_dev) _o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel _o="${_o},nofail" #with nofail set, systemd won't block for mount failure
- _mntopts="$_t $_o"
- _mntopts="$_t $_o 0 2"
What is 0 here. I think you are trying to emulate the format of an fstab file and passing 5th and 6th field.
I don't think they are filesystem options. If you trying to mount a file system with 0 and 2 passed as additional parameters, mount will complain that what is 0 and 2 it does not understand.
yes, kind of... as it is now, it would generate an invalid fstab line
while pop fstab_lines line; do printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab" done
but most of the tools would accept that and the fsck would be done
I am CCing harald. He might have thoughts on what's the better way to pass the fsck_passno of filesystem being mounted. I would not mind of passno 2 is hardcoded for anything passed in using --mount option in dracut.
we can also check if those are present, and set "0 0" as the default if nothing is given in "--mount"
Ok, so you don't mind being passed in fs_freq and fs_passno as last fields of --mount option.
In that case, Dave can you please also post a patch to modify dracut to parse these fields and use default of "0 0" only if use did not pass those.
Sure, will do
Hmm, what Harald mentioned is already in dracut code. I think we only need to pass them in kdump module.
Thanks Dave
Ok, so you don't mind being passed in fs_freq and fs_passno as last fields of --mount option.
In that case, Dave can you please also post a patch to modify dracut to parse these fields and use default of "0 0" only if use did not pass those.
Sure, will do
Hmm, what Harald mentioned is already in dracut code. I think we only need to pass them in kdump module.
Rechecking it, dracut still need a fix to parse the extra options because it only add "0 0" unconditionally.
The previous testing passed of this patch because dracut just regard the "0 2" as mount options and later fstab-sys mount.sh parse the "2" as pass_no.
Thanks Dave
On 02/13/14 at 09:42am, Vivek Goyal wrote:
On Wed, Feb 12, 2014 at 03:22:30PM +0800, Dave Young wrote:
We are using dracut --mount to pass fstab lines for mounting filesystems other than rootfs. But we did not provide passno for filesystem checking.
Add passno '2' for all the --mount targets.
Tested in F19 guest.
Signed-off-by: Dave Young dyoung@redhat.com
mkdumprd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- kexec-tools.orig/mkdumprd +++ kexec-tools/mkdumprd @@ -104,7 +104,7 @@ to_mount() { _o=$(findmnt -k -f -n -r -o OPTIONS $_dev) _o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel _o="${_o},nofail" #with nofail set, systemd won't block for mount failure
- _mntopts="$_t $_o"
- _mntopts="$_t $_o 0 2"
What is 0 here. I think you are trying to emulate the format of an fstab file and passing 5th and 6th field.
I don't think they are filesystem options. If you trying to mount a file system with 0 and 2 passed as additional parameters, mount will complain that what is 0 and 2 it does not understand.
The _mntopts does not means the real "mount options" it's just a string for cancat and create a fstab line then pass to dracut. Currently it contains the mount target and mount options, and it contains fs_freq and fs_passno after this patch.
Probably should we change the local variable name to something "_line"?
Thanks dave
On Fri, Feb 14, 2014 at 10:37:35AM +0800, Dave Young wrote:
On 02/13/14 at 09:42am, Vivek Goyal wrote:
On Wed, Feb 12, 2014 at 03:22:30PM +0800, Dave Young wrote:
We are using dracut --mount to pass fstab lines for mounting filesystems other than rootfs. But we did not provide passno for filesystem checking.
Add passno '2' for all the --mount targets.
Tested in F19 guest.
Signed-off-by: Dave Young dyoung@redhat.com
mkdumprd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- kexec-tools.orig/mkdumprd +++ kexec-tools/mkdumprd @@ -104,7 +104,7 @@ to_mount() { _o=$(findmnt -k -f -n -r -o OPTIONS $_dev) _o=${_o/#ro/rw} #mount fs target as rw in 2nd kernel _o="${_o},nofail" #with nofail set, systemd won't block for mount failure
- _mntopts="$_t $_o"
- _mntopts="$_t $_o 0 2"
What is 0 here. I think you are trying to emulate the format of an fstab file and passing 5th and 6th field.
I don't think they are filesystem options. If you trying to mount a file system with 0 and 2 passed as additional parameters, mount will complain that what is 0 and 2 it does not understand.
The _mntopts does not means the real "mount options" it's just a string for cancat and create a fstab line then pass to dracut. Currently it contains the mount target and mount options, and it contains fs_freq and fs_passno after this patch.
That's an implementation detail. dracut does not promise that it is going to put this in a /etc/fstab file. What if dracut directly decides to use mount command.
mount -t <filesystem ype> -o <filesystem options> <device> <mountpoint>
In this case mount will fail if you decide to pass 0 and 2. For example I tried following and it failed.
mount -t ext4 -o data=ordered,0,2 /dev/sdb /mnt/wd-ssd1/
While following succeeded.
mount -t ext4 -o data=ordered /dev/sdb /mnt/wd-ssd1/
That's why I am insisting that we modify dracut man page and make it explicit. fs_freq and fs_passno are not mount options. You try to pass them as mount options, and mount will fail.
Probably should we change the local variable name to something "_line"?
Or explicity use local variable names as fs_freq and fs_passno (taken from fstab man page).
Thanks Vivek