[Bug 759635] New: os-prober fails to mount UFS2 partitions
https://bugzilla.novell.com/show_bug.cgi?id=759635 https://bugzilla.novell.com/show_bug.cgi?id=759635#c0 Summary: os-prober fails to mount UFS2 partitions Classification: openSUSE Product: openSUSE 12.2 Version: Milestone 3 Platform: x86-64 OS/Version: openSUSE 12.2 Status: NEW Severity: Normal Priority: P5 - None Component: Bootloader AssignedTo: jsrain@suse.com ReportedBy: hippolyte@shaw.ca QAContact: jsrain@suse.com Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0 os-prober detects BSD UFS partitions but fails to mount ufs2 without the proper ufs type (ufs2). I seems to default to 44bsd (mount -u ufs is equivalent to mount -u ufs -o ufstype=44bsd). Reproducible: Always Steps to Reproduce: 1. add the --verbose option (-v) to the mount command and do not redirect standard error in file /usr/lib/os-probes/50mounted-tests --- /usr/lib/os-probes/50mounted-tests.orig 2012-04-27 03:05:50.883133225 -0700 +++ /usr/lib/os-probes/50mounted-tests 2012-04-27 03:48:58.885248552 -0700 @@ -60,7 +60,7 @@ else ro_partition "$partition" for type in $types $delaytypes; do - if mount -o ro -t "$type" "$partition" "$tmpmnt" 2>/dev/null; then + if mount -v -o ro -t "$type" "$partition" "$tmpmnt" ; then debug "mounted as $type filesystem" mounted=1 break 2. run os-prober on a system with ufs2 partitions Actual Results: ... /dev/sda22 on /var/lib/os-prober/mount type ufs (ro) /dev/sda23 on /var/lib/os-prober/mount type ufs (ro) /dev/sda24 on /var/lib/os-prober/mount type ufs (ro) mount: wrong fs type, bad option, bad superblock on /dev/sda25, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so mount: wrong fs type, bad option, bad superblock on /dev/sda26, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so mount: wrong fs type, bad option, bad superblock on /dev/sda27, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so /dev/sda28 on /var/lib/os-prober/mount type ufs (ro) ... Expected Results: /dev/sda24 on /var/lib/os-prober/mount type ufs (ro,ufstype=44bsd) /dev/sda25 on /var/lib/os-prober/mount type ufs (ro,ufstype=ufs2) /dev/sda25:unknown Linux distribution:Linux1:linux /dev/sda26 on /var/lib/os-prober/mount type ufs (ro,ufstype=ufs2) /dev/sda27 on /var/lib/os-prober/mount type ufs (ro,ufstype=ufs2) /dev/sda27:unknown Linux distribution:Linux2:linux /dev/sda28 on /var/lib/os-prober/mount type ufs (ro,ufstype=44bsd) The outputs of actual and expected results will be different when you remove the option -v from the mount command. I just used this option here for debugging. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c2
Andreas Jaeger
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c3
--- Comment #3 from Agnelo de la Crotche
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c4
--- Comment #4 from Agnelo de la Crotche
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c5
--- Comment #5 from Agnelo de la Crotche
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c6
--- Comment #6 from Michael Chang
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c7
--- Comment #7 from Agnelo de la Crotche
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c8
--- Comment #8 from Agnelo de la Crotche
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c9
--- Comment #9 from Agnelo de la Crotche
Oh, I can explain the code in os-prober-50mounted-tests.patch too. I occasionally have problems mounting Linux partitions (on different machines and under different distros). I haven't been able to figure out the reason, but mounting again if it fails seems to solve the issue in most cases. Once a partition has be mounted (either manually or by os-prober), the problem disappears.
No. Mounting again within the script doesn't help since it "seems" (but is not true) that the partition which fails to mount requires a system check but is mounted read-only. I desribed this issue with more details in this bug report: https://bugzilla.novell.com/show_bug.cgi?id=767272 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c10
Andrey Borzenkov
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c11
--- Comment #11 from Agnelo de la Crotche
12.3 is using grub2-mount in preference to OS mount. Could you test if it works better? You will need to replace all occurrences of grub-mount/grub-probe with grub2-mount/grub2-probe in os-prober sources.
I don't have 12.3 installed anywhere. I can indeed mount both ufs1 and ufs2 slices with grub2-mount manually (under 12.2). It uses fuse instead of the ufs filesystem driver and doesn't show differences between ufs1 and ufs2. In both cases, mount will report: grub2-mount on /mnt type fuse.grub2-mount (rw,nosuid,nodev,relatime,user_id=0,group_id=0) Someone has to try with os-prober, because mounting the slice is only the first step. You still have to know what to look for and where in order to detect the NetBSD or other BSD kernels and add the boot entry (which requires some code as well). On the other hand, os-prober should NOT look for Linux kernels in ufs* slices - as it used to do. I had to fix this as well. It generates a lot of useless warnings (and takes longer too). * unless people would install Linux in ufs file systems, but I don't know anyone who does that. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c12
--- Comment #12 from Andrey Borzenkov
I don't have 12.3 installed anywhere. I can indeed mount both ufs1 and ufs2 slices with grub2-mount manually (under 12.2).
Good.
Someone has to try with os-prober, because mounting the slice is only the first step. You still have to know what to look for and where in order to detect the NetBSD or other BSD kernels and add the boot entry (which requires some code as well).
On the other hand, os-prober should NOT look for Linux kernels in ufs* slices - as it used to do. I had to fix this as well. It generates a lot of useless warnings (and takes longer too).
* unless people would install Linux in ufs file systems, but I don't know anyone who does that.
As far as I understand you already have working implementation. Care to provide clean patch against Base:System/os-prober for review? You may want to wait until I push os-prober 1.57 or take home:arvidjaar:grub2-next/os-prober as reference. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c13
ahlner ahlner
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c14
--- Comment #14 from Agnelo de la Crotche
Number Start End Size Type File system Flags 1 32,3kB 11,5GB 11,5GB primary sun-ufs boot, type=a9 2 11,5GB 35,4GB 23,9GB primary ext4 type=83 4 35,4GB 148GB 112GB extended lba, type=0f 5 35,4GB 36,0GB 535MB logical linux-swap(v1) type=82
# grub2-mount /dev/sdb1 /mnt
Salut @ahlner, What you're trying to do is impossible. You're trying to mount the NetBSD primary partition (0xA9). This is not how you mount (any) BSD slice under Linux. This partition can never be mounted. It is only a "container", just like the extended partition. Many Linux tools are also buggy and see this partition while they should ignore it. The "ignore" option was even dropped in the latest mount utilities (or linux utils, or something, not sure how it is called). Thus the following trick (which I'm still using in openSUSE 12.2) won't work anymore any time soon (and probably has already stopped working under 12.3) # ignore FreeBSD primaries /dev/sda2 none ignore /dev/sda3 none ignore /dev/sdb2 none ignore /dev/sdb3 none ignore Otherwise I suggest writing udev rules to hide these partitions for a cleaner desktop. I had a discussion with an ArchLinux developper, who had a discussion with an udev developper, and I got the impression that (at least those) Linux developpers neither know nor care about those BSD primaries. I'm afraid this is just the way it is. In any case, you never mount such a partition. You can think of it as the extended partition (0x0f) in DOS/MBR partition scheme. Whether your kernel can actually read the NetBSD disklabel is another question. I'm quite sure it can read any BSD disklabel. All BSD disklabels are different and more or less compatible with each other. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c15
--- Comment #15 from ahlner ahlner
https://bugzilla.novell.com/show_bug.cgi?id=759635
https://bugzilla.novell.com/show_bug.cgi?id=759635#c16
Jeffrey Cheung
participants (1)
-
bugzilla_noreply@novell.com