Hard drive issues - Centos Stream 8

Issues related to hardware problems
Post Reply
gurutech
Posts: 72
Joined: 2014/07/09 01:35:35

Hard drive issues - Centos Stream 8

Post by gurutech » 2022/05/27 03:05:48

OK, haven't been here on a while, having some personal things going on in my life that take precedence, but I'm here now because I'm in the process of replacing my hard drives in my system (a 500gb primary drive, and a 2tb data drive) with a pair of 4tb drives.

I've done "dd" on each drive so that 500gb --> 4tb, and 2tb --> 4tb, using a USB drive with Centos 9 Steam "Live" installed on it so I can "dd" each of the other drives. However neither drive shows full capacity at 4tb. They both max out at 2tb. I did some googling and found that both of my current drives are MBR, and I need to convert them to GPT. I've done this with my data drive, then just manually copied all the data over, which took a couple days.

I'm trying to do the same with the 500gb drive, to format the replacement 4tb drive with GPT, but when I "dd" the drive, it resets back to MBR. I've thought I could just manually set up the partitions the same way as they are on the 500gb drive, then just "dd" the partitions instead of the entire drive, but I've failed miserably at this. At least I haven't destroyed the data on my 500gb drive (yet!)

Is there a quick and easy way to migrate my 500gb drive to the new 4tb drive and use the full capacity? As it is, I can't even make the remaining space a new partition because I'm still limited by the MBR to 2tb.

On this drive (/dev/sda) I have sda1 as my 1gb boot partition, then sda2 as my lvm2 pv, with the remainder of the drive space. The lvm2 is split as 50gb, 15.8gb swap, and 399gb /home.

How can I essentially do a "dd", but make the new drive a GPT partition and not MBR? I've looked into converting the new drive from MBR to GPT without losing data, but every time I've tried this, I end up losing the data (I do have a backup, so it's just frustration at this point.)

gurutech
Posts: 72
Joined: 2014/07/09 01:35:35

Re: Hard drive issues - Centos Stream 8

Post by gurutech » 2022/05/27 04:04:27

Think I may have gotten it.... Here's what I've done so far...

Boot from the 500gb drive, with the 4tb data drive connected. Connect the other 4tb primary drive via USB (making it /dev/sdc).
Run gparted and delete everything on sdc. Had to use lvm to remove the lvm partition, but figured that out fairly quickly.
run sgdisk -R to copy partition table from sda to sdc. Refresh gparted, and it came up with the 1gb boot partition and 465gb lvm. Extended LVM to remainder of drive, so now I have 1gb boot and 3.7tb (approx) lvm.
Currently in the process of using dd to copy sda2 to sdc2 (lvm to lvm). Already copied sda1 to sdc1. Hoping that took, but may have to figure out how to copy the actual boot partition to sdc. Will also find out when dd is done with sdc2 (will most likely take overnight due to the 500gb drive being slow - hence the reason for replacing it).

User avatar
TrevorH
Site Admin
Posts: 32406
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Hard drive issues - Centos Stream 8

Post by TrevorH » 2022/05/27 07:54:20

If you are replacing one boot drive that is < 2TB and using a DOS MBR with one that is > 2TB and using GPT then you are likely to run into all sorts of problems yet.

If your machine is in Legacy BIOS mode then it cannot boot from a GPT labelled disk directly. It will need something called a 'biosbot' partition defined, formatted and with grub installed on it. The only way I know of to get this is to reinstall though I've not looked and there may be devious ways to get this done.

If your machine is in UEFI mode then it won't need a biosboot partition but it is not an easy task to convert from Legacy BIOS mode to UEFI so if you were in LB mode already then it's not an easy switch either.

I think you would be better off installing both new drives into the system and reinstalling from scratch. Then attach your old drives via USB and copy the data you want to the newly installed system - NOT including the boot drive/root filesystem though you may need some selected individual files from the old /etc directory.
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke

gurutech
Posts: 72
Joined: 2014/07/09 01:35:35

Re: Hard drive issues - Centos Stream 8

Post by gurutech » 2022/05/29 03:17:58

ok, so my method didn't work the way I wanted it to. I ended up downloading Centos 9 Stream and installing that on a blank 4TB drive, and that worked, but the boot drive became sdb for some reason, and my 4TB data drive became sda. And when I rebooted, I got the "pull stop root" error (I think that's what it was called. Basically wouldn't let me boot. It was the issue where the grub.cfg file was corrupt, but I couldn't get to a point where I could fix it within the recovery console. Not sure why, but when I installed Centos 9, it gave me a /boot and a /boot/efi mounting point. Not sure if that's a new feature with Centos 9, or if it's like that because I'm on a 4TB drive now.

So I'm in the process now of download Centos 8 Stream (which I am currently running) and will dd that to my 1TB USB drive, remove the 4TB data drive from my system (temporarily), install Centos 8 on a reclaimed space 4TB boot drive (I'm calling them "boot" and "data"), install updates, power down, connect the 4TB data drive, boot back up and hope for the best.

If it helps, my intended configuration is a 1gb boot partition, 100gb root, 48gb swap (I have 32gb RAM), and the remaining space for "home". If there's a better method, I'm all ears!

User avatar
TrevorH
Site Admin
Posts: 32406
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Hard drive issues - Centos Stream 8

Post by TrevorH » 2022/05/29 13:13:49

You know that all Stream releases are effectively beta versions, right?

I'd use Rocky/Alma/OEL in preference.

CentOS is no longer what it was and is effectively dead.
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke

gurutech
Posts: 72
Joined: 2014/07/09 01:35:35

Re: Hard drive issues - Centos Stream 8

Post by gurutech » 2022/11/13 00:36:33

Well, darn. I did end up getting everything working by reinstalling Centos 8 Stream from a USB drive with only the first 4TB drive connected. Then I copied the data from the old 500gb drive it replaced, and then connected the second 4TB drive, formatted it, and copied the data from the old 2TB drive (like copy/paste, not "dd" as that gave me problems), and then removed the old drives completely. Tested everything out for a bit before wiping the old drives.

But now I feel like I'm wasting hard drive space. I have my boot/swap/root and extended partition (including /home) on one drive (way too much space allocated for "home"), so I shelled out some cash for an NVMe SSD drive, with plans on migrating my current setup to Rocky Linux (downloading now) and boot off the SSD, and mirror my two 4TB drives. Hopefully I'll get some better performance out of the new setup.

That's the plan anyway. And with Centos being basically a beta version, I guess that's why I could never get Centos 9 Stream to work properly. LOL

Post Reply