mount /dev/sdb8 etc wipes contents of sdb7?? What's up wit dat?

Folks:

Complicated story, have a multi-multi-boot set up on my MacPro '12 . . . posting the question here because there can be conversation, the problem bridges across the Gecko Rolling, the TW . . . and the Manjaro installs that I have on /sdb7,8,9 . . . since I used the TW TTY to run these commands I feel it’s “OK” to post the question here . . . . I ran this “mount” command to try to “fix” a fresh install of Gecko that on reboot had a “kernel not found” error, although as I had the experience before in TW where first reboot into system was fine, but second was not . . . wasn’t sure what the issue was. Booted Super Grub to try to boot the install and that failed. I booted into TW and dropped into a TTY and ran this data from @knurpht that worked for my install of TW a few months back:

I'm not going to read the entire thread again, so please replace  '/dev/sdX#' by the proper entry for your root fs. Boot from a TW install  image, hit Ctrl+Alt+F2, you'll see a root prompt. Then do: 
 	Code:
 	mount /dev/sdb8 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
mount -a
yast 
Go System - Bootloader, make sure "Probe for foreign OS" is checked. Hit OK. 
Exit YaST
hit Ctrl+D to exit the chroot, reboot.

When I was “in” the Gecko Yast Bootloader I couldn’t arrow around and “check” “Probe for foreign OS” . . . but I could move between “kernel parameters” and the three tab headings . . . so in actual fact I couldn’t make any changes in Gecko Yast while I was there, but seems like “mounting” the partition did something so that on reboot Grub found it and although it showed another error, “video not found”?? it still loaded the kernel and Gecko booted up!!!

I then went to Gecko’s Yast Bootloader and checked “Probe foreign OS” . . . and I rebooted . . . back into TW . . . which already had the “probe foreign OS” checked from the last time we went through the “grub not finding opensusetw” problem here in this forum.

So all appeared to be fine, until this morning, this should be “Manjaro” day . . . but now in Grub there is no Manjaro option??? Booted up the SuperGrub2 disk, found the /EFI/manjaroxxxx file, clicked go . . . and into a black “grub rescue” cursor??? Don’t know what to enter, so I put “reboot” . . . and nope, “command not found” . . . .

Shut the machine down, booted into TW and launched GParted . . . and seems like sdb7 . . . only has “447 MB” of data . . . unidentified data?? I haven’t run anything other than SG2, and system updates in TW, Gecko, and U-MATE . . . didn’t try to mount “sdb7” and/or do anything with sdb7 . . . but it now appears to be gone?

Is there something in using TTY to “mount” a partition that would erase the partition next to it??? Seems odd, it’s not like before in TW where something in the installer “broke” the Grub menu contents for TW, but the data for “/” was there and I could log in via TTY and run zypper updates . . . here data appears to have been surgically removed??? By another system, in this case possibly one of the adjacent OSs, which happen to both be opensusetw??? The only thing that remains of Manjaro are a couple of lines in grub cfg & efi . . . that error to grub rescue . . . . :open_mouth:

No. But if you have a corrupt partition table, then there could be overlapping partitions. And, in that case, there would be problems.

@nrickert:

Thanks for the reply . . . “corruption”??? A lot of that going around these days . . . I don’t think the partition table is corrupted, but how would I check for that?

I’ve been messing in linux for well over a decade and I don’t recall too many incidence where data once installed was “wiped” . . . unless the installer bled over and put data on top of other data, but removing some, but leaving “447MB” of non-bootable data?? Seems strange, no?

Well, post the partition table if you want that anybody helps you in interpreting it. As root:

fdisk -l

BTW,I have not read all (let alone understand all) you wrote, but on your question “can mounting a file system corrupt the file system that is adjacent to it”, the answer, as already given, is no. But, when you mount them e.g. on the same mount point, you will only see the contents of the last mounted one. The other is not corrupted, but you simply can not see the data from within your system.

@hcvv:

Thanks for the postings on “fdisk” . . . I’m away from that computer now, so I’ll post back later with that data. Appreciate that you didn’t read for understanding on what I posted, certainly I understand that when a system is “mounted” all that we see will be that system . . . just like booting through grub, there might be a number of systems available, and we pick one to run at the time.

I’m talking about subsequent to getting Gecko “fixed” to boot, the Manjaro data in an adjacent partition shows up . . . as a partition for “/” but only has 447 MB of filesystem showing in GParted . . . .

Disk /dev/sda: 232.91 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Mercury Electra 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: AE3BFD84-809E-4CBD-8C97-8CB91BA0822E

Device      Start       End   Sectors   Size Type
/dev/sda1      40    409639    409600   200M EFI System
/dev/sda2  409640 488397127 487987488 232.7G unknown


Disk /dev/sdb: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000DM010-2EP1
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: F1161268-E36C-44A2-B2B6-F0B1FEC1FD0A

Device          Start        End   Sectors   Size Type
/dev/sdb1          40     409639    409600   200M EFI System
/dev/sdb2      409640  491208671 490799032   234G Apple HFS/HFS+
/dev/sdb3   492478208  983267695 490789488   234G Apple HFS/HFS+
/dev/sdb4   983267696  984537231   1269536 619.9M Apple boot
/dev/sdb5   984537232 1430032607 445495376 212.4G Apple HFS/HFS+
/dev/sdb6  1430032608 1431302143   1269536 619.9M Apple boot
/dev/sdb7  1431302144 1532518399 101216256  48.3G Linux filesystem
/dev/sdb8  1532518400 1634918399 102400000  48.8G Linux filesystem
/dev/sdb9  1634918400 1737318399 102400000  48.8G Linux filesystem
/dev/sdb10 1737318400 1926143999 188825600    90G Linux filesystem
/dev/sdb11 1926144000 1953523711  27379712  13.1G Linux swap


Disk /dev/sdc: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-00B
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: 453477A3-2476-4320-B59A-C172BB69F019

Device          Start        End   Sectors   Size Type
/dev/sdc1          40     409639    409600   200M EFI System
/dev/sdc2      409640  585868783 585459144 279.2G Apple HFS/HFS+
/dev/sdc3   585868784  587138327   1269544 619.9M Apple HFS/HFS+
/dev/sdc4   587138328 1308527031 721388704   344G Apple HFS/HFS+
/dev/sdc5  1308790784 1415690239 106899456    51G Microsoft basic data
/dev/sdc6  1415952384 1513606680  97654297  46.6G Linux filesystem
/dev/sdc7  1513607168 1611263999  97656832  46.6G Linux filesystem
/dev/sdc8  1611264000 1922275327 311011328 148.3G Linux filesystem
/dev/sdc9  1922275328 1953523711  31248384  14.9G Linux swap


Yikes!!!

My experience with multiboot on a Mac makes me a firm believer anyone doing it is a glutton for punishment. Mine is a mid-2007 iMac with only El Capitan and two Leap releases.

My experience with UEFI makes me a believer that anyone using more than one ESP partition is a glutton for punishment.

This makes you in my eyes a very serious glutton for punishment. You must have copious mental fortitude/stamina.

Have you ever considered cutting back on ESP partitions to just one?

Could it be that the Mac firmware is causing the 1TB disks to be logically swapped, sda->sdb & sdb->sda (without the Electra disk - is it a rescue firewire or USB stick of some Apple sort?), according to what was booted last or is currently booted, thus confusing sdX7 & 8 when accessing via device names instead of UUIDs? 447MB looks an awful lot like the difference between 48.3G and 48.8G.

You have three EFI system partitions (EFS)!

Which bootloader is in which EFS?

Which EFS is used to boot from?

Please show the result of

# efibootmgr -v

Regards

susejunky

Hi
Yes, stick to one or two… I have a MacBook3,1 (circa late 2007) one disk, one efi partition, but I use the boot menu to get to osX and efi to get to Leap (the default)…

@mrmazda:

Thanks for stopping by . . . I started in linux in my '00 iMac 800 and that was “difficult” to get the right xorg.conf file set up to run linux . . . it was “glutton for punishment” . . . but in this Mac Pro with Intel cpu it isn’t that difficult . . . it’s “gluttony for pleasure” . . . it is pleasure-seeking based. OSX sets up the EFI partition with any install it runs . . . so each drive yes, has it’s own EFI partition . . . .

@susejunky:

Thanks also for posting in . . . right now I’m booted in the Gecko partition, which should be “sdb8” I believe. second disk from the sun, etc.

BootCurrent: 0000
BootOrder: 0001,0002,0000,0080
Boot0000* ubuntu    HD(1,GPT,1470d224-08ec-4863-9e67-93af726f576b,0x28,0x64000)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* opensusetw-secureboot    HD(1,GPT,0d8470db-279c-4890-8cdb-8af7d48ab8c4,0x28,0x64000)/File(\EFI\opensusetw\shim.efi)
Boot0002* grub    HD(1,GPT,7f39c61b-b9d1-4378-8478-a5e99ae6079d,0x28,0x64000)/File(\EFI\grub\grubx64.efi)
Boot0080* Mac OS X    PciRoot(0x0)/Pci(0x1f,0x2)/Sata(3,0,0)/HD(3,GPT,7420b4c3-007e-4b98-b566-eaa4ebf5e403,0x1d5a9f00,0x1d40da70)
Boot0081* Mac OS X    PciRoot(0x0)/Pci(0x1f,0x2)/Sata(3,0,0)/HD(2,GPT,3447e9e0-204a-414f-a226-9f19fa88ef29,0x64028,0x1d40ffb8)
Boot0082*     PciRoot(0x0)/Pci(0x1f,0x2)/Sata(4,0,0)/HD(2,GPT,af6b309f-1c2b-41ae-a5e9-7153c2a0c953,0x64028,0x22e565c8)
BootFFFF*     PciRoot(0x0)/Pci(0x1f,0x2)/Sata(3,0,0)/HD(1,GPT,7f39c61b-b9d1-4378-8478-a5e99ae6079d,0x28,0x64000)/File(\EFI\BOOT\BOOTX64.efi)


Guys, point is that until just a few days back, I could boot into any of my many OSs on this computer, grub had them listed, and all was in good order, until the recent re-install of Gecko, which similarly to my install of OpenSUSETW some months back . . . got messed up (by the installer???) . . . and after chrooting sdb8 to “mount” that “fixed” Gecko, but the price was/is . . . Manjaro partition data has been wiped??? It’s 447MB of data . . . and consequently Grub has no “Manjaro” option . . . that is the present problem . . . ???

Just to warn you: Up to now i have never used apple machines. So i’m not really familiar with the way they boot.

However it looks like your UEFIs NVRAM has only entries for LINUX-systems on one disk (= one EFS). Does that EFS contain the bootloaders for all your installed LINUX-systems?

Regards

susejunky

Hi
So if you efi boot to an openSUSE release and run as root user;


os-prober

Do you see the release you lost from grub? If not in one of the efi partitions does it still exist? If so, just manually create with efibootmgr and specify the disk.

@susejunky:

Yes, it seems like grub has the most OSs listed under the sdb EFI . . . although the two ubuntu’s seem to have their own EFI disk to boot from the OSX boot manager window . . . so three “EFI” disks show up there . . . but the sdb item shows all of the options . . . now Manjaro is essentially “erased” through no effort of pain or pleasure seeking of my own . . . .

@malcolmlewis:

Thanks also to you for stopping by . . . ran your commands, still in the Gecko flavor of the moment . . . . As you can see, Manjaro is AOL . . . .

# os-prober
/dev/sdb9:openSUSE Tumbleweed:openSUSE:linux
/dev/sdc2:Mac OS X:MacOSX:macosx
/dev/sdc6:Ubuntu Focal Fossa (development branch) (20.04):Ubuntu:linux
/dev/sdc7:Ubuntu Focal Fossa (development branch) (20.04):Ubuntu:linux


Hi
What about down in each /boot/efi/EFI directory on the efi partitions?

Well, what would I do, run “/boot/efi/EFI”??? I’m not a “natural” or trained console user. The primary Grub isn’t listing Manjaro, and GParted is showing the data in that partition isn’t much to speak of . . . question is simply, the “why” of it?

Why would this happen to a seeker of linux “pleasure” ? How did we get here? : - ))))

Hi
Switch to root user and manually mount, check, unmount…


su -
mount /dev/sdb8 /mnt
ls /mnt/EFI
umount /dev/sdb8

OK, followed that suggestion, with some other options . . . the “EFI” partition should be “sdb1”??? but tried that, “does not exist,” “sdb8” is Gecko “/” partition, but none of them seemed to work? I tried also the “Manjaro” option of “sdb7”???

n:/home/n # mount /dev/sdb8 /mnt
n:/home/n # ls /mnt/EFI
ls: cannot access '/mnt/EFI': No such file or directory
n:/home/n # umount /dev/sdb8

n:/home/n # mount dev/sdb1 /mnt
mount: /mnt: special device dev/sdb1 does not exist.
n:/home/n # umount /dev/sdb1

n:/home/n # mount /dev/sdb7 /mnt
n:/home/n # ls /mnt/EFI
ls: cannot access '/mnt/EFI': No such file or directory
n:/home/n # umount /dev/sdb7

n:/home/n # mount /dev/sdb /mnt
mount: /mnt: /dev/sdb already mounted or mount point busy.
n:/home/n # ls /mnt/EFI
ls: cannot access '/mnt/EFI': No such file or directory
n:/home/n # umount /dev/sdb
umount: /dev/sdb: not mounted.

I see in post #7 EFI System Partitions at sda1, sdb1 and sdc1.