[SOLVED] GPT & legacy boot problems on cloned drive

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
Doranwen
Level 3
Level 3
Posts: 172
Joined: Mon Nov 05, 2012 1:53 am

[SOLVED] GPT & legacy boot problems on cloned drive

Post by Doranwen »

This will take a bit of explaining, so please bear with me:

While my main OS is running Mint 21.2, I have an older box that I keep which runs Mint 13 Mate 64-bit. I have some good reasons for having an OS this old on it (please be assured I'm not using it to browse the Internet! lol), which aren't really relevant to this problem - but they do mean that I'm not willing to just wipe the drive and install something else. I have extensive programs and files configured for the tasks I do on there, and while I was able to migrate some of them to other systems, I could NOT get IDJC (which I have running all the time on the comp in question) to run properly in VirtualBox, so I need to get it working again.

I previously backed up the drive by booting off a live disc of a more recent Mint (I think I'd burned 20.3 to a DVD at one point, having lots of spare DVDs and not so many spare USB sticks), installing ddrescue to the live session, and cloning it bit for bit. At least, I was pretty sure I did that! (I'd tried Clonezilla and it didn't work and at the time the attempt I'd made to use Foxclone also had failed, so I went back to something I knew should give me a perfect copy.)

The problem is that when the main hdd finally began to fail, as I figured it would do eventually, I went to put the most recent clone in its spot, thinking that if it was a perfect copy of the original, it should work instantly. Sadly, I was wrong; it gave me the message "GPT-formatted disk. Legacy boot not supported!"

I've tried to research how to fix this, but everything I'm coming up with wasn't too helpful, as it was for fresh installs, people moving drives from one comp to another, etc. The most helpful thing I found was a suggestion to install boot-repair to a live session (which I've done) and see what it suggests, which is this: http://sprunge.us/8gIE79

I feel like I should be able to figure out the next steps, but all of the data is sort of running at me every which way and my head isn't sorting it out. The one thing I do NOT want to do is to mess with the main OS/home partition (sda2). I can shrink sda3 (which is just swap) a little if I need to carve out another partition, but clearly that isn't going to work if it needs a bunch of space at the *beginning* of a drive. I *do* have another clone of the same drive, if I have to use it, but I would MUCH rather not - the one I have in there right now is the most recent and I'd like to keep that functioning.

I don't *think* I changed any BIOS settings in the process of trying to back up last-minute file changes and whatnot, but if I need to restart and poke at the settings, let me know.
Last edited by Doranwen on Thu Apr 11, 2024 8:26 pm, edited 1 time in total.
JeremyB
Level 21
Level 21
Posts: 13911
Joined: Fri Feb 21, 2014 8:17 am

Re: GPT & legacy boot problems on cloned drive

Post by JeremyB »

Doranwen
Level 3
Level 3
Posts: 172
Joined: Mon Nov 05, 2012 1:53 am

Re: GPT & legacy boot problems on cloned drive

Post by Doranwen »

I read that, but none of it seems to apply to my situation. I made a perfect copy of a drive that already worked on that system, and upon switching the main OS drive out for its clone, it decides not to work. I'm trying to figure out how to fix that, or if the issue is that I simply accidentally changed a setting in BIOS when I was trying to boot the comp off the live DVD the other day. Upgrading to a more recent version of Mint is not an option, nor is simply wiping the drive and starting over.

If worse comes to worst, I'll purchase a new drive, install the same old OS on it, reinstall all the programs using the old repos, and copy over all the configs and data files. I'd like to *not* have to do that, as it will take a while just for the new drive to get here (there's nowhere nearby I can go purchase one, shipping is the only option), and then it will take quite a bit of installing and configuration to get everything up and running. That's why I asked here if there was a way to fix it without touching the data.

Also, I'd love to know why it didn't boot off a perfect clone, and if I can prevent that from happening again. Everything I read said that using ddrescue to clone drives gave a perfect copy. Was that wrong? Is something else going on that I'm not aware of? I've used this technique to back up multiple main OS drives and dread the possibility of going through this with another computer.
User avatar
AndyMH
Level 21
Level 21
Posts: 13859
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: GPT & legacy boot problems on cloned drive

Post by AndyMH »

Doranwen wrote: Wed Apr 03, 2024 2:13 am Also, I'd love to know why it didn't boot off a perfect clone, and if I can prevent that from happening again. Everything I read said that using ddrescue to clone drives gave a perfect copy. Was that wrong? Is something else going on that I'm not aware of? I've used this technique to back up multiple main OS drives and dread the possibility of going through this with another computer.
Earlier info indicates that you are booting legacy, if you copied the partitions you will have missed the first stage bootloader in the first sector on the drive.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Doranwen
Level 3
Level 3
Posts: 172
Joined: Mon Nov 05, 2012 1:53 am

Re: GPT & legacy boot problems on cloned drive

Post by Doranwen »

AndyMH wrote: Wed Apr 03, 2024 6:47 am Earlier info indicates that you are booting legacy, if you copied the partitions you will have missed the first stage bootloader in the first sector on the drive.
I had ddrescue copy the entire drive, not specific partitions. Does it not copy the entire drive including the bootloader if told to backup /dev/sda, for instance? (Now I'm wondering how to fix that with the XP comp I keep around for some specific software. If its hard drive fails - which it's likely to do in the next year or two, I need to be able to plop a replacement in and have it work.)
User avatar
AndyMH
Level 21
Level 21
Posts: 13859
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: GPT & legacy boot problems on cloned drive

Post by AndyMH »

That should have worked, or I can't think of a reason why it won't. I'd try re-installing grub, straightforward for legacy boot.

Boot an install stick, open a terminal and

Code: Select all

sudo mount /dev/sdXY /mnt 
sudo grub-install --boot-directory=/mnt/boot /dev/sdX 
Where sdX is your system drive, e.g. sda, and sdXY is your / partition on the drive, e.g. sda1.

I'd be interested in why foxclone didn't work.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Doranwen
Level 3
Level 3
Posts: 172
Joined: Mon Nov 05, 2012 1:53 am

Re: GPT & legacy boot problems on cloned drive

Post by Doranwen »

AndyMH wrote: Wed Apr 03, 2024 12:53 pm That should have worked, or I can't think of a reason why it won't. I'd try re-installing grub, straightforward for legacy boot.

Boot an install stick, open a terminal and

Code: Select all

sudo mount /dev/sdXY /mnt 
sudo grub-install --boot-directory=/mnt/boot /dev/sdX 
Where sdX is your system drive, e.g. sda, and sdXY is your / partition on the drive, e.g. sda1.
On this comp, sda1 is the /boot partition, sda2 is /, and sda3 is swap. (I suspect I didn't partition /home separately because I knew I would not be upgrading the comp past Mint 13 when I installed it.) Does that change any of those directions?
AndyMH wrote: Wed Apr 03, 2024 12:53 pm I'd be interested in why foxclone didn't work.
Yeah, I wish I remembered exactly what happened - it was at least a year or so ago, and I've had so much going on. Those details didn't stick in my brain, I guess. I think I had trouble getting it to boot on the older systems? I can see it might've had trouble on the old XP box, I don't remember whether that CPU was 64-bit capable or not. But this one's 64-bit for sure so who knows.
User avatar
AndyMH
Level 21
Level 21
Posts: 13859
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: GPT & legacy boot problems on cloned drive

Post by AndyMH »

Doranwen wrote: Wed Apr 03, 2024 4:07 pm Does that change any of those directions?
Yes. You don't need a separate boot partition unless you are using LVM or LUKS.

Code: Select all

sudo mount /dev/sdXY /mnt 
sudo grub-install --boot-directory=/mnt/boot /dev/sdX 
should be

Code: Select all

sudo mount /dev/sda1 /mnt 
sudo grub-install --boot-directory=/mnt /dev/sda 
i.e. pointing at your /boot partition and I'm not sure it will work.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Doranwen
Level 3
Level 3
Posts: 172
Joined: Mon Nov 05, 2012 1:53 am

Re: GPT & legacy boot problems on cloned drive

Post by Doranwen »

AndyMH wrote: Wed Apr 03, 2024 5:47 pm Yes. You don't need a separate boot partition unless you are using LVM or LUKS.
I installed this quite some years ago and I think I got confused trying to read online how to best partition things. My current box is quite a bit different, lol.
AndyMH wrote: Wed Apr 03, 2024 5:47 pm

Code: Select all

sudo mount /dev/sda1 /mnt 
sudo grub-install --boot-directory=/mnt /dev/sda 
i.e. pointing at your /boot partition and I'm not sure it will work.
It wouldn't mount the partition. Said:

Code: Select all

NTFS signature is missing.
failed to mount '/dev/sda1': Invalid argument
The device 'dev/sda1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
User avatar
AndyMH
Level 21
Level 21
Posts: 13859
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: GPT & legacy boot problems on cloned drive

Post by AndyMH »

Ahh... just looked at your boot-repair output.

sda1 is your bios_grub partition, where grub lives on a drive partitioned with a GPT partition table.

So it should be

Code: Select all

sudo mount /dev/sda2 /mnt 
sudo grub-install --boot-directory=/mnt/boot /dev/sda 
Quite how you managed to install LM13 (which is a long way out of date) on a GPT drive in legacy mode is beyond me. I thought this was a fairly recent innovation. Not a standard install.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Doranwen
Level 3
Level 3
Posts: 172
Joined: Mon Nov 05, 2012 1:53 am

Re: GPT & legacy boot problems on cloned drive

Post by Doranwen »

AndyMH wrote: Wed Apr 03, 2024 6:10 pm Ahh... just looked at your boot-repair output.

sda1 is your bios_grub partition, where grub lives on a drive partitioned with a GPT partition table.

So it should be

Code: Select all

sudo mount /dev/sda2 /mnt 
sudo grub-install --boot-directory=/mnt/boot /dev/sda 
I followed it carefully - said no error reported. But alas, it still gives me the same error message when I attempt to boot off it. :/ Am I doomed to reinstalling from scratch and copying over configs?
AndyMH wrote: Wed Apr 03, 2024 6:10 pm Quite how you managed to install LM13 (which is a long way out of date) on a GPT drive in legacy mode is beyond me. I thought this was a fairly recent innovation. Not a standard install.
Well, I installed it *when* it was quite out of date. I had used it on my old box (now replaced with a newer tower) and when I upgraded to Mint 18 I found some things I relied on heavily for very specific tasks would not work properly on anything newer. So I got a bare comp just to put Mint 13 on. Given when 18 came out, it had to be at least 2016. I don't recall doing that specifically, either! So I'm not sure exactly what happened. It always worked up until switching out these drives.
User avatar
AndyMH
Level 21
Level 21
Posts: 13859
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: GPT & legacy boot problems on cloned drive

Post by AndyMH »

Something I should have asked - you are not trying to boot with the original drive and the clone in the system at the same time? This would confuse grub - two / partitions with identical UUIDs - which one does it choose?

Assuming you still have the original drive untouched, I've only one suggestion left.
  • Fit both drives in the system, the original and the one you want to clone to.
  • Boot an install stick and run gparted.
  • Put a new partition table on the clone drive - this will wipe the drive. Choose msdos as the partition table type. This is what is normally associated with legacy boot. I'm hoping this will remove any issues associated with trying to boot legacy using a bios_grub partition on a GPT drive.
  • Then, using gparted, copy/paste your / and swap partitions from the original drive to the clone. If it asks, paste them as "primary" partitions.
  • Then install grub as advised previously, except your / partition will be sda1 (you can see and check this in gparted):

Code: Select all

sudo mount /dev/sda1 /mnt 
sudo grub-install --boot-directory=/mnt/boot /dev/sda 
Shutdown, disconnect/remove the original drive and reboot, make sure BIOS is set legacy boot and boot from sda (or whatever your first drive shows as in BIOS). Does it work?
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Doranwen
Level 3
Level 3
Posts: 172
Joined: Mon Nov 05, 2012 1:53 am

Re: GPT & legacy boot problems on cloned drive

Post by Doranwen »

AndyMH wrote: Thu Apr 04, 2024 6:46 am Something I should have asked - you are not trying to boot with the original drive and the clone in the system at the same time? This would confuse grub - two / partitions with identical UUIDs - which one does it choose?
No, I removed both the original drive and a separate data storage drive I'd had in there as both were failing. The only drive in the tower at this point is the clone.
AndyMH wrote: Thu Apr 04, 2024 6:46 am Assuming you still have the original drive untouched, I've only one suggestion left.
  • Fit both drives in the system, the original and the one you want to clone to.
  • Boot an install stick and run gparted.
  • Put a new partition table on the clone drive - this will wipe the drive. Choose msdos as the partition table type. This is what is normally associated with legacy boot. I'm hoping this will remove any issues associated with trying to boot legacy using a bios_grub partition on a GPT drive.
  • Then, using gparted, copy/paste your / and swap partitions from the original drive to the clone. If it asks, paste them as "primary" partitions.
  • Then install grub as advised previously, except your / partition will be sda1 (you can see and check this in gparted):

Code: Select all

sudo mount /dev/sda1 /mnt 
sudo grub-install --boot-directory=/mnt/boot /dev/sda 
Shutdown, disconnect/remove the original drive and reboot, make sure BIOS is set legacy boot and boot from sda (or whatever your first drive shows as in BIOS). Does it work?
The original drive was close enough to failing that I'm not sure I should try copying off it a second time. When I tried to make a fresh last backup, ddrescue only got through 68% of the drive. Mind you, I'm pretty sure that 68% was all the actual data and it started to have problems right at the end of that, but it just got "stuck", for lack of a better word. Didn't show errors, didn't change numbers, it was like it was frozen on it. So I ended it. The late-backup clone mounts fine for copying files off but it didn't work to even *try* booting from (which is why i was trying to boot from an older clone) - I don't think I can make a clone of it that'll actually work. Or, rather, I probably need to get a new drive just to do this on. I don't want to risk that last-minute backup as some of that data will be valuable, and I definitely don't have a spare drive at the moment to try this with. So I guess I'm ordering another drive, lol. I'll take a close look at this when it gets here, then.

Also, I don't suppose it matters at all that the tower in question *does* have UEFI capability, it just wasn't used when setting this up. (I'm still puzzled as to how it worked fine with the original drive and doesn't now with the clone. That worries me, that *somehow* something went wrong here that will affect other clones I've done - like my XP system, which has an installation of a program that I *won't* be able to redo if I have to reinstall the OS.)
Doranwen
Level 3
Level 3
Posts: 172
Joined: Mon Nov 05, 2012 1:53 am

Re: GPT & legacy boot problems on cloned drive

Post by Doranwen »

OK, I'm pretty sure I know why I had a GPT partition table - the hdd is 4TB. Msdos tables can't handle more than 2TB, from what I'm reading. Somehow I'd set it up to boot off of that with a legacy boot method and it actually worked until I tried to swap drives. /\o/\ Not sure how I managed that one, but.

So do I set this up to boot uefi, install the proper uefi partitions and copy the / partition later in the disk and just create the swap partition smaller enough to account for it so I don't mess up data, or what? The mobo *does* seem to have UEFI capability - I mean, I got this system in 2016 or so - so it should be doable… I'm just a little unsure of how to do it right so it'll actually *work*. And can Mint 13 even work with UEFI? If it can't, I really don't know how to fix this. It *did* work somehow!

EDIT: I should note that I *have* done tons of searches. I keep getting instructions that confuse me, that don't quite apply to my situation, etc. From what I can see Mint 13 *did* work with UEFI, but how I should set things up from here in order to copy partitions over and have it just boot… I can't figure it out from all my searching.

EDIT #2: Because the current problem was a bit different from the original one, I posted here, and eventually did get the computer to boot fine with UEFI!
Post Reply

Return to “Installation & Boot”