Previously if a target need mount info, the relevant mount options are got from /proc/mounts by below command: findmnt -k -f -n -r -o OPTIONS $_dev
This will bring problems. Since /proc/mounts will give out a set which contains each option. Some options have value specified by user, some options just have default value if user doesn't specify. If some mount options are not supported very well, bugs occured. The more options, the worse.
So in this patch, we try to check fstab to get mount options firstly, this give user a chance to decide which options they really want. If they don't give a fstab entry, then we trust all options in /proc/mounts.
Signed-off-by: Baoquan He bhe@redhat.com --- mkdumprd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index 409235b..e9246f2 100644 --- a/mkdumprd +++ b/mkdumprd @@ -104,7 +104,12 @@ 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) + if [ -z "$_options" ]; then + _options=$(findmnt -k -f -n -r -o OPTIONS $_dev) + elif [ "$_options" = "defaults" ]; then + _options="" + fi _options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel # "x-initrd.mount" mount failure will trigger isolate emergency service # W/o this, systemd won't isolate, thus we won't get to emergency.
On 09/04/14 at 04:59pm, Baoquan He wrote:
Previously if a target need mount info, the relevant mount options are got from /proc/mounts by below command: findmnt -k -f -n -r -o OPTIONS $_dev
This will bring problems. Since /proc/mounts will give out a set which contains each option. Some options have value specified by user, some options just have default value if user doesn't specify. If some mount options are not supported very well, bugs occured. The more options, the worse.
So in this patch, we try to check fstab to get mount options firstly, this give user a chance to decide which options they really want. If they don't give a fstab entry, then we trust all options in /proc/mounts.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index 409235b..e9246f2 100644 --- a/mkdumprd +++ b/mkdumprd @@ -104,7 +104,12 @@ 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)
- if [ -z "$_options" ]; then
_options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
- elif [ "$_options" = "defaults" ]; then
_options=""
- fi
defaults should put into options instead of blank string becuase we are passing fstab lines to dracut..
_options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel # "x-initrd.mount" mount failure will trigger isolate emergency service # W/o this, systemd won't isolate, thus we won't get to emergency.
-- 1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 09/04/14 at 05:26pm, Dave Young wrote:
--- a/mkdumprd +++ b/mkdumprd @@ -104,7 +104,12 @@ 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)
- if [ -z "$_options" ]; then
_options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
- elif [ "$_options" = "defaults" ]; then
_options=""
- fi
defaults should put into options instead of blank string becuase we are passing fstab lines to dracut..
Yes, you are right. Will post v2.
Previously if a target need mount info, the relevant mount options are got from /proc/mounts by below command: findmnt -k -f -n -r -o OPTIONS $_dev
This will bring problems. Since /proc/mounts will give out a set which contains each option. Some options have value specified by user, some options just have default value if user doesn't specify. If some mount options are not supported very well, bugs occured. The more options, the worse.
So in this patch, we try to check fstab to get mount options firstly, this give user a chance to decide which options they really want. If they don't give a fstab entry, then we trust all options in /proc/mounts.
Signed-off-by: Baoquan He bhe@redhat.com --- mkdumprd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index 409235b..a30d9ca 100644 --- a/mkdumprd +++ b/mkdumprd @@ -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) _options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel # "x-initrd.mount" mount failure will trigger isolate emergency service # W/o this, systemd won't isolate, thus we won't get to emergency.
On Thu, Sep 04, 2014 at 05:38:17PM +0800, Baoquan He wrote:
Previously if a target need mount info, the relevant mount options are got from /proc/mounts by below command: findmnt -k -f -n -r -o OPTIONS $_dev
This will bring problems. Since /proc/mounts will give out a set which contains each option. Some options have value specified by user, some options just have default value if user doesn't specify. If some mount options are not supported very well, bugs occured. The more options, the worse.
So in this patch, we try to check fstab to get mount options firstly, this give user a chance to decide which options they really want. If they don't give a fstab entry, then we trust all options in /proc/mounts.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index 409235b..a30d9ca 100644 --- a/mkdumprd +++ b/mkdumprd @@ -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.
Thanks Vivek
On 09/15/14 at 11:09am, Vivek Goyal wrote:
On Thu, Sep 04, 2014 at 05:38:17PM +0800, Baoquan He wrote:
Previously if a target need mount info, the relevant mount options are got from /proc/mounts by below command: findmnt -k -f -n -r -o OPTIONS $_dev
This will bring problems. Since /proc/mounts will give out a set which contains each option. Some options have value specified by user, some options just have default value if user doesn't specify. If some mount options are not supported very well, bugs occured. The more options, the worse.
So in this patch, we try to check fstab to get mount options firstly, this give user a chance to decide which options they really want. If they don't give a fstab entry, then we trust all options in /proc/mounts.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index 409235b..a30d9ca 100644 --- a/mkdumprd +++ b/mkdumprd @@ -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.
Thanks Vivek
On Tue, Sep 16, 2014 at 03:06:25PM +0800, Baoquan He wrote:
On 09/15/14 at 11:09am, Vivek Goyal wrote:
On Thu, Sep 04, 2014 at 05:38:17PM +0800, Baoquan He wrote:
Previously if a target need mount info, the relevant mount options are got from /proc/mounts by below command: findmnt -k -f -n -r -o OPTIONS $_dev
This will bring problems. Since /proc/mounts will give out a set which contains each option. Some options have value specified by user, some options just have default value if user doesn't specify. If some mount options are not supported very well, bugs occured. The more options, the worse.
So in this patch, we try to check fstab to get mount options firstly, this give user a chance to decide which options they really want. If they don't give a fstab entry, then we trust all options in /proc/mounts.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index 409235b..a30d9ca 100644 --- a/mkdumprd +++ b/mkdumprd @@ -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.
Thanks Vivek
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.
Thanks Baoquan
Thanks Vivek
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
On 09/17/14 at 08:49am, Vivek Goyal wrote:
On Wed, Sep 17, 2014 at 06:46:49PM +0800, Baoquan He wrote:
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.
I added x-systemd.device-timeout=1 into the nfs mount entry of /etc/fstab, kdump can load and dump successfully. That means this can be recognized by mount and dracut doesn't filter it out specifically.
Below is the fstab of my kvm guest:
[root@localhost ~]# cat /etc/fstab
# # /etc/fstab # Created by anaconda on Fri Mar 21 06:21:58 2014 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more # info # /dev/mapper/fedora-root / ext4 defaults 1 1 UUID=a3ab560e-e001-403a-b470-974ee5c1bf53 /boot ext4 defaults 1 2 /dev/mapper/fedora-swap swap swap defaults 0 0 192.168.100.227:/var/crash/nfs /mnt nfs defaults,x-systemd.device-timeout=1 0 0
Thanks Vivek
On Thu, Sep 04, 2014 at 05:38:17PM +0800, Baoquan He wrote:
Previously if a target need mount info, the relevant mount options are got from /proc/mounts by below command: findmnt -k -f -n -r -o OPTIONS $_dev
This will bring problems. Since /proc/mounts will give out a set which contains each option. Some options have value specified by user, some options just have default value if user doesn't specify. If some mount options are not supported very well, bugs occured. The more options, the worse.
So in this patch, we try to check fstab to get mount options firstly, this give user a chance to decide which options they really want. If they don't give a fstab entry, then we trust all options in /proc/mounts.
Signed-off-by: Baoquan He bhe@redhat.com
Acked-by: Vivek Goyal vgoyal@redhat.com
Vivek
mkdumprd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index 409235b..a30d9ca 100644 --- a/mkdumprd +++ b/mkdumprd @@ -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) _options=${_options/#ro/rw} #mount fs target as rw in 2nd kernel # "x-initrd.mount" mount failure will trigger isolate emergency service # W/o this, systemd won't isolate, thus we won't get to emergency.
-- 1.8.5.3
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On Thu, Sep 04, 2014 at 04:59:29PM +0800, Baoquan He wrote:
Previously if a target need mount info, the relevant mount options are got from /proc/mounts by below command: findmnt -k -f -n -r -o OPTIONS $_dev
This will bring problems. Since /proc/mounts will give out a set which contains each option. Some options have value specified by user, some options just have default value if user doesn't specify. If some mount options are not supported very well, bugs occured. The more options, the worse.
So in this patch, we try to check fstab to get mount options firstly, this give user a chance to decide which options they really want. If they don't give a fstab entry, then we trust all options in /proc/mounts.
Signed-off-by: Baoquan He bhe@redhat.com
mkdumprd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/mkdumprd b/mkdumprd index 409235b..e9246f2 100644 --- a/mkdumprd +++ b/mkdumprd @@ -104,7 +104,12 @@ 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)
- if [ -z "$_options" ]; then
_options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
- elif [ "$_options" = "defaults" ]; then
_options=""
- fi
Bao, why do we set options to null in case of "defaults"?
man page says following.
defaults use default options: rw, suid, dev, exec, auto, nouser, and async.
So who comes up with defult values of these paratmers?
Secondly, what happens to parameters like.
x-systemd.device-timeout=0
I think kernel does not uderstand these options. Will we not get errors during mounting if we don't filter out these options?
Thanks Vivek