Bug 1159557

Summary: YaST > Partitioner removes Bind entries from /etc/fstab
Product: [openSUSE] openSUSE Distribution Reporter: Henk van Velden <henk.vanvelden>
Component: YaST2Assignee: YaST Team <yast-internal>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P2 - High CC: aschnell, henk.vanvelden, jlopez, jreidinger, shundhammer
Version: Leap 15.1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://trello.com/c/BhPYesPV
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Henk van Velden 2019-12-19 14:16:50 UTC
This was originally reported on Tumbleweed by someone on the openSUSE forums, but I can re-create it on LEAP 15.1

Situation at start is a rather simple one disk system:
boven:~ # fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-60W
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0AAF3B2B-2BCB-41BF-841D-C0E6A627F6E7

Device        Start       End   Sectors  Size Type
/dev/sda1      2048    534527    532480  260M EFI System
/dev/sda2    534528  17317887  16783360    8G Microsoft basic data
/dev/sda3  17317888  59262975  41945088   20G Microsoft basic data
/dev/sda4  59262976 478689279 419426304  200G Microsoft basic data


boven:~ #

Added a bind mount entry to /etc/fstab and mounted it.

boven:~ # cat /etc/fstab
UUID=7dc53b12-93a9-4e97-b0ae-ab165a8bd688 /                    ext4       acl,user_xattr        1 1
UUID=212ea772-7bec-4bee-85b5-786f7a810356 swap                 swap       defaults              0 0
UUID=A626-CF2D       /boot/efi            vfat       umask=0002,utf8=true  0 0
UUID=8c561c1d-e51f-4eb9-a28a-92b3a98df5be /home                ext4       defaults              1 2
tmpfs                   /tmp    tmpfs   size=25%,uid=root,gid=root,mode=1777    0 0

/home/wij /home/henk/wij none bind

boven:~ # mount | grep '/dev'
devtmpfs on /dev type devtmpfs (rw,nosuid,size=4001676k,nr_inodes=1000419,mode=755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
/dev/sda3 on / type ext4 (rw,relatime,data=ordered)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/sda4 on /home type ext4 (rw,relatime,data=ordered)
/dev/sda4 on /home/henk/wij type ext4 (rw,relatime,data=ordered)
boven:~ #

Then I used YaST > Partitioner to create a new partition /dev/sda5, made an ext4 file system on it and set it to mount (now and on boot) on /mnt.

boven:~ # fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-60W
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0AAF3B2B-2BCB-41BF-841D-C0E6A627F6E7

Device         Start       End   Sectors  Size Type
/dev/sda1       2048    534527    532480  260M EFI System
/dev/sda2     534528  17317887  16783360    8G Microsoft basic data
/dev/sda3   17317888  59262975  41945088   20G Microsoft basic data
/dev/sda4   59262976 478689279 419426304  200G Microsoft basic data
/dev/sda5  478689280 489175039  10485760    5G Linux filesystem


boven:~ #

Look now in /etc/fstab:
boven:~ # cat /etc/fstab
UUID=7dc53b12-93a9-4e97-b0ae-ab165a8bd688  /          ext4   acl,user_xattr        1  1
UUID=212ea772-7bec-4bee-85b5-786f7a810356  swap       swap   defaults              0  0
UUID=A626-CF2D                             /boot/efi  vfat   umask=0002,utf8=true  0  0
UUID=8c561c1d-e51f-4eb9-a28a-92b3a98df5be  /home      ext4   defaults              1  2
tmpfs                                      /tmp       tmpfs  size=25%,uid=root,gid=root,mode=1777  0  0
UUID=e54b13d3-2b73-40ad-b502-00e99c1ad2c6  /mnt       ext4   defaults              0  2
boven:~ #

The new entry is there, but the Bind mount entry (and the empty line) are gone.
Comment 1 Stefan Hundhammer 2019-12-19 14:27:14 UTC
So this is the line in /etc/fstab that you added manually:

/home/wij /home/henk/wij none bind

Right?


I think it should work well if you also specify both numeric fields, the dump pass no. and the fsck pass no:


/home/wij /home/henk/wij none bind 0 0


Please try that. 

I think the parser might consider it a syntax error / bad format if you omit those fields, so that entry (together with the empty line before it which would qualify as a comment line) rejects it upon reading, so it is not written back upon writing.
Comment 2 Henk van Velden 2019-12-19 15:15:00 UTC
I tried as you suggested and you are right. The entry now stays:
UUID=7dc53b12-93a9-4e97-b0ae-ab165a8bd688  /               ext4   acl,user_xattr        1  1
UUID=212ea772-7bec-4bee-85b5-786f7a810356  swap            swap   defaults              0  0
UUID=A626-CF2D                             /boot/efi       vfat   umask=0002,utf8=true  0  0
UUID=8c561c1d-e51f-4eb9-a28a-92b3a98df5be  /home           ext4   defaults              1  2
tmpfs                                      /tmp            tmpfs  size=25%,uid=root,gid=root,mode=1777  0  0

/home/wij                                  /home/henk/wij  none   bind                  0  0
UUID=f47d31b5-ff94-42d4-bd93-1d80fc6b602d  /mnt            ext4   defaults              0  2

Even the empty line is still there.
I will go back to the OP of the forums thread to check what he has.

It is a bit against my ideas about what YaST should do. Should it really "repair" entries that it does not like without any comment made? Even the mount command did not protest.

In any case, this case may be closed as a correct entry will result in no problem at all.

Thanks for the quick reaction.
Comment 3 Josef Reidinger 2019-12-27 10:39:01 UTC
I keep it open and add it to our queue for fix as it is 

1. data loss
2. 5th and 6th entry is optional and according to man page defaults to 0 if not specified.
Comment 4 Henk van Velden 2019-12-27 11:18:06 UTC
I agree and support your follow up. Thanks.
Comment 5 José Iván López González 2020-01-09 12:55:17 UTC
Optional fs_dump and fs_passno columns are supported now (included in versions 4.1.106 (SP1) and 4.2.48 (factory) of libstorage-ng).

* https://github.com/openSUSE/libstorage-ng/pull/693
* SP1: https://build.suse.de/request/show/208969
* Factory: https://build.suse.de/request/show/208997