Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: North of Boston, Mass (North Shore/Cape Ann)
Distribution: CentOS 7.0 (and kvm/qemu)
Posts: 91
Rep:
CentOS Software RAID:1 disk replacement
Hi.
I have two 2TiB drives. When I installed my CentOS on my new machine oh so many years ago, I chose to let it do a software RAID. The next thing I chose was to let LVM handle everything. So those things have been invoked using the usual incantations, I didn't make a lot of choices.
The RAID is checked occassionally, and comes up clean.
However, logwatch is giving me lots of UC errors on my sdb.
So perhaps I should change it out.
This link seems to be a clear and simple procedure to follow.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
You should check if your phsycial volume is on /dev/md0. Just to be sure. It is the normal way to create LVM on top of RAID, not the other way around. Use pvdisplay.
It also seems that you boot partition is on /dev/sda1. The RAID comprised sda2 and sdb1. It seems that you can safely replace sdb.
Note that mdadm is very resilient. If you fail one disk, and things go wrong with the new disk you can re-install and re-add the old disk and that is surprisingly successful.
As always, I recommend to create a VM and simulate the complete process on a test environment before doing this in production.
I miss the boot partition on /dev/sdb. It means that you cannot boot if /dev/sda fails. That is something which should have been covered during installation of the RAID, but apparently it is not.
Location: North of Boston, Mass (North Shore/Cape Ann)
Distribution: CentOS 7.0 (and kvm/qemu)
Posts: 91
Original Poster
Rep:
Hi.
Thanks.
I can't be sure of the order I built things, it was so long ago.
I suspect that the build would do it correctly, that neophytes in building a CentOS system like myself at the time, would just follow the line of questioning.
As to /dev/md, this is what I get, and it's the only 'md' device.
Code:
sudo pvdisplay
--- Physical volume ---
PV Name /dev/md127
VG Name centos
PV Size <1.82 TiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 476774
Free PE 31
Allocated PE 476743
PV UUID mq3sH4-h8wr-ciOf-BsQ1-Tnh5-6wNL-qVufCT
The boot worries me as well.
The "fdisk.txt" enclosed in the original post shows /dev/sda2 equivalent in size to /dev/sdb1 so they are "raid'd" up, which leads me believe I can easily replace my second TiB drive (which, fortunately, is my problem at the moment), but I'm S*OuttaLuck if I need to replace my first TiB drive because of the missing "boot" designation. I was hoping I was mis-reading something, but it seems you've confirmed my fears.
Location: North of Boston, Mass (North Shore/Cape Ann)
Distribution: CentOS 7.0 (and kvm/qemu)
Posts: 91
Original Poster
Rep:
I'd love to VM and test before I go live, but, my 'raid' is my physical system.
Essentially the only thing I do when I physically boot the system, other than check root's email and do a
Code:
# yum update
weekly, is run the KVM (initiates at boot) then with
Code:
virt-manager
access the VMs that I use for work-stations.
If it's of any interest/use, my disk in my Linux VM looks like this:
Code:
sudo fdisk -l
Disk /dev/vda: 34.4 GB, 34359738368 bytes, 67108864 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0008c089
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 1026047 512000 83 Linux
/dev/vda2 1026048 67108863 33041408 8e Linux LVM
Disk /dev/mapper/centos_gamgee-root: 30.3 GB, 30349983744 bytes, 59277312 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/centos_gamgee-swap: 3435 MB, 3435134976 bytes, 6709248 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Looks like I'm sunk if my primary TiB drive goes bad.
It's only a boot partition - the data should be safe. And of course, you could always restore your backup.
It is interesting that anaconda would build a system like that when a boot partition was allocated. Let's see this.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
Like syg00 it is only a boot sector which is missing. It is just annoying if the boot disk fails you'd have more work and it takes more time to get a running system again. Fortunately "not booting" is a small problem in Linux.
As for the VM, you'd be able to build a VM on this very system on which you have the failing disk problem. With 10GB space you have plenty to install Centos and a few RAID disks. It is all in the VDI or VMX file, remember?
Location: North of Boston, Mass (North Shore/Cape Ann)
Distribution: CentOS 7.0 (and kvm/qemu)
Posts: 91
Original Poster
Rep:
Thanks.
Code:
Like syg00 it is only a boot sector which is missing.
It is just annoying if the boot disk fails you'd have more work and it takes more time to
get a running system again.
Fortunately "not booting" is a small problem in Linux.
As for the VM, you'd be able to build a VM on this very system on which you have the
failing disk problem.
With 10GB space you have plenty to install Centos and a few RAID disks.
It is all in the VDI or VMX file, remember?
jlinkels
I'll keep a link to this discussion in my notes.
So far, the uncorrectable errors on the 'spare' disks are annoying.
When I'm ready, later in the Fall, I'll start doing the step-by-step as you recommend.
Thank you for your help, counsel and advice.
I'll NOT mark this 'solved', as it won't be solved until I actually do it -- I may have further questions later.
(Unless you'd rather I do otherwise.)
It's not just the MBR code that would need replacing - the boot partition will need creating and the grub package itself re-installed to get the code installed on the second disk as well. Then grub2-install (I assume, Fedora uses that naming), then mkconfig.
Presumably there is sufficient free space on that second disk you could allocate a partition for /boot to be mirrored to. Not trivial, but you could arrange a RAID1 set yourself for /boot after that - the MBR would still need updating on that (second) disk as well. Not sure about dracut for the booting - must be some doco on the web somewhere.
Last edited by syg00; 08-14-2018 at 01:05 AM.
Reason: hopefully add some clarity
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.