ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
62 stars 58 forks source link

zdev root fs detection fails for btrfs #129

Closed sharkcz closed 2 years ago

sharkcz commented 2 years ago

I believe this is an oddity of btrfs, but when btrfs is used for the root filesystem and the fs is spread across multiple devices, then zdev adds only one rule into the initrd rendering the system unbootable :-(

[root@openshift-8 boot]# lsblk
NAME     MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
dasda     94:0    0  6.9G  0 disk 
├─dasda1  94:1    0    1G  0 part /boot
└─dasda2  94:2    0  5.9G  0 part /home
                                  /
dasdb     94:4    0  6.9G  0 disk 
└─dasdb1  94:5    0  6.9G  0 part 
dasdc     94:8    0  6.9G  0 disk 
└─dasdc1  94:9    0  6.9G  0 part 
dasdd     94:12   0  6.9G  0 disk 
└─dasdd1  94:13   0  6.9G  0 part 
zram0    252:0    0  7.8G  0 disk [SWAP]
[root@openshift-8 boot]# lsdasd
Bus-ID    Status    Name      Device  Type         BlkSz  Size      Blocks
================================================================================
0.0.5422  active    dasda     94:0    ECKD         4096   7043MB    1803060
0.0.5522  active    dasdb     94:4    ECKD         4096   7043MB    1803060
0.0.5622  active    dasdc     94:8    ECKD         4096   7043MB    1803060
0.0.5722  active    dasdd     94:12   ECKD         4096   7043MB    1803060
[root@openshift-8 boot]# chzdev -f -e 5422,5522,5622,5722
ECKD DASD 0.0.5422 configured
ECKD DASD 0.0.5522 configured
ECKD DASD 0.0.5622 configured
ECKD DASD 0.0.5722 configured
Note: The initial RAM-disk must be updated for these changes to take effect:
       - ECKD DASD 0.0.5422
Update initial RAM-disk now? (yes/no) yes
Building initial RAM-disk
cat: /sys/power/resume: No such file or directory
Installing IPL record
Using config file '/etc/zipl.conf'
Using BLS config file '/boot/loader/entries/89f522141e764ad7b1f17d1e00216521-5.15.12-200.fc35.s390x.conf'
Using BLS config file '/boot/loader/entries/89f522141e764ad7b1f17d1e00216521-5.15.6-200.fc35.s390x.conf'
Using BLS config file '/boot/loader/entries/89f522141e764ad7b1f17d1e00216521-5.14.18-300.fc35.s390x.conf'
Using BLS config file '/boot/loader/entries/89f522141e764ad7b1f17d1e00216521-0-rescue.conf'
Building bootmap in '/boot'
Building menu 'zipl-automatic-menu'
Adding #1: IPL section '(5.15.12-200.fc35.s390x)' (default)
Adding #2: IPL section '(5.15.6-200.fc35.s390x)'
Adding #3: IPL section '(5.14.18-300.fc35.s390x)'
Adding #4: IPL section '(0-rescue-89f522141e764ad7b1f17d1e00216521)'
Preparing boot device: dasda (5422).
Done.

As you can see chzdev adds 5422 into the initrd, but rather all 4 DASDs are required.

oberpar commented 2 years ago

This should be fixed with commit ad024c06e16ec4bba31d19fb848b42c67113143d.

hoeppnerj commented 2 years ago

@sharkcz can you please verify that the commit mentioned by @oberpar fixes this issue? Thanks!

sharkcz commented 2 years ago

It doesn't seem to be sufficient to fix it ...

[root@openshift-8 ~]# lsdasd
Bus-ID    Status    Name      Device  Type         BlkSz  Size      Blocks
================================================================================
0.0.5522  active    dasda     94:0    ECKD         4096   7043MB    1803060
0.0.5622  active    dasdb     94:4    ECKD         4096   7043MB    1803060
0.0.5422  active    dasdc     94:8    ECKD         4096   7043MB    1803060
0.0.5722  active    dasdd     94:12   ECKD         4096   7043MB    1803060

[root@openshift-8 ~]# lsblk -P -o NAME,MAJ:MIN,FSTYPE,UUID,MOUNTPOINT,PKNAME 2>/dev/null
NAME="dasda" MAJ_MIN="94:0" FSTYPE="" UUID="" MOUNTPOINT="" PKNAME=""
NAME="dasda1" MAJ_MIN="94:1" FSTYPE="ext4" UUID="a9284e9f-16e2-439a-8959-b88ba9e976ed" MOUNTPOINT="/boot" PKNAME="dasda"
NAME="dasda2" MAJ_MIN="94:2" FSTYPE="btrfs" UUID="30efdb5e-51ef-4188-87fa-60665d3eb096" MOUNTPOINT="/home" PKNAME="dasda"
NAME="dasdb" MAJ_MIN="94:4" FSTYPE="" UUID="" MOUNTPOINT="" PKNAME=""
NAME="dasdb1" MAJ_MIN="94:5" FSTYPE="btrfs" UUID="30efdb5e-51ef-4188-87fa-60665d3eb096" MOUNTPOINT="" PKNAME="dasdb"
NAME="dasdc" MAJ_MIN="94:8" FSTYPE="" UUID="" MOUNTPOINT="" PKNAME=""
NAME="dasdc1" MAJ_MIN="94:9" FSTYPE="btrfs" UUID="30efdb5e-51ef-4188-87fa-60665d3eb096" MOUNTPOINT="" PKNAME="dasdc"
NAME="dasdd" MAJ_MIN="94:12" FSTYPE="" UUID="" MOUNTPOINT="" PKNAME=""
NAME="dasdd1" MAJ_MIN="94:13" FSTYPE="btrfs" UUID="30efdb5e-51ef-4188-87fa-60665d3eb096" MOUNTPOINT="" PKNAME="dasdd"
NAME="zram0" MAJ_MIN="252:0" FSTYPE="" UUID="" MOUNTPOINT="[SWAP]" PKNAME=""

but

[root@openshift-8 ~]# chzdev -f -e 5422,5522,5622,5722
ECKD DASD 0.0.5422 configured
ECKD DASD 0.0.5522 configured
ECKD DASD 0.0.5622 configured
ECKD DASD 0.0.5722 configured
Note: The initial RAM-disk must be updated for these changes to take effect:
       - ECKD DASD 0.0.5522
Update initial RAM-disk now? (yes/no) no
Operation canceled on user request
oberpar commented 2 years ago

Hm, seems this could be related to the fact that a single block device provides multiple mount points. Could you provide the output of the following command?

lsblk -P -o NAME,MAJ:MIN,FSTYPE,UUID,MOUNTPOINT,MOUNTPOINTS,PKNAME
sharkcz commented 2 years ago
[root@openshift-8 ~]# lsblk -P -o NAME,MAJ:MIN,FSTYPE,UUID,MOUNTPOINT,MOUNTPOINTS,PKNAME
NAME="dasda" MAJ_MIN="94:0" FSTYPE="" UUID="" MOUNTPOINT="" MOUNTPOINTS="" PKNAME=""
NAME="dasda1" MAJ_MIN="94:1" FSTYPE="ext4" UUID="a9284e9f-16e2-439a-8959-b88ba9e976ed" MOUNTPOINT="/boot" MOUNTPOINTS="/boot" PKNAME="dasda"
NAME="dasda2" MAJ_MIN="94:2" FSTYPE="btrfs" UUID="30efdb5e-51ef-4188-87fa-60665d3eb096" MOUNTPOINT="/home" MOUNTPOINTS="/home\x0a/" PKNAME="dasda"
NAME="dasdb" MAJ_MIN="94:4" FSTYPE="" UUID="" MOUNTPOINT="" MOUNTPOINTS="" PKNAME=""
NAME="dasdb1" MAJ_MIN="94:5" FSTYPE="btrfs" UUID="30efdb5e-51ef-4188-87fa-60665d3eb096" MOUNTPOINT="" MOUNTPOINTS="" PKNAME="dasdb"
NAME="dasdc" MAJ_MIN="94:8" FSTYPE="" UUID="" MOUNTPOINT="" MOUNTPOINTS="" PKNAME=""
NAME="dasdc1" MAJ_MIN="94:9" FSTYPE="btrfs" UUID="30efdb5e-51ef-4188-87fa-60665d3eb096" MOUNTPOINT="" MOUNTPOINTS="" PKNAME="dasdc"
NAME="dasdd" MAJ_MIN="94:12" FSTYPE="" UUID="" MOUNTPOINT="" MOUNTPOINTS="" PKNAME=""
NAME="dasdd1" MAJ_MIN="94:13" FSTYPE="btrfs" UUID="30efdb5e-51ef-4188-87fa-60665d3eb096" MOUNTPOINT="" MOUNTPOINTS="" PKNAME="dasdd"
NAME="zram0" MAJ_MIN="252:0" FSTYPE="" UUID="" MOUNTPOINT="[SWAP]" MOUNTPOINTS="[SWAP]" PKNAME=""
oberpar commented 2 years ago

Yes, that confirms my assumption:

NAME="dasda2" MAJ_MIN="94:2" FSTYPE="btrfs" UUID="30efdb5e-51ef-4188-87fa-60665d3eb096" MOUNTPOINT="/home" MOUNTPOINTS="/home\x0a/" PKNAME="dasda"

Current zdev code isn't compatible with devices that provide multiple mount-points. Fixing this shouldn't be too difficult, but I'm not sure when this can be provided. Is there any deadline associated with the occurrence of the problem in your case?

sharkcz commented 2 years ago

I believe we can keep it open for some time, ideally with some documentation note. There is no deadline and one can do custom storage setup when installing Fedora, so there is a workaround.

hoeppnerj commented 2 years ago

@sharkcz despite automatically closing this issue when I've pushed the corresponding commit, could you please still confirm the fix? Thanks a lot!

sharkcz commented 2 years ago

yes, I will give it a try

sharkcz commented 2 years ago

yup, it looks good

[root@openshift-8 ~]# chzdev -f -e 5422,5522,5622,5722
ECKD DASD 0.0.5422 configured
ECKD DASD 0.0.5522 configured
ECKD DASD 0.0.5622 configured
ECKD DASD 0.0.5722 configured
Note: The initial RAM-disk must be updated for these changes to take effect:
       - ECKD DASD 0.0.5522
       - ECKD DASD 0.0.5622
       - ECKD DASD 0.0.5422
       - ECKD DASD 0.0.5722
Update initial RAM-disk now? (yes/no) yes
Building initial RAM-disk
...
hoeppnerj commented 2 years ago

yup, it looks good

[root@openshift-8 ~]# chzdev -f -e 5422,5522,5622,5722
ECKD DASD 0.0.5422 configured
ECKD DASD 0.0.5522 configured
ECKD DASD 0.0.5622 configured
ECKD DASD 0.0.5722 configured
Note: The initial RAM-disk must be updated for these changes to take effect:
       - ECKD DASD 0.0.5522
       - ECKD DASD 0.0.5622
       - ECKD DASD 0.0.5422
       - ECKD DASD 0.0.5722
Update initial RAM-disk now? (yes/no) yes
Building initial RAM-disk
...

Thanks a lot for the verification!