LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-15-2015, 09:38 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
How to access LV in PV on foreign disk with md?


A disk with a partition which was an md underlying device in another system was fitted. After booting, the foreign md was listed in /proc/mdstat but the foreign VG was not listed by vgs.

The vgchange -ay run during boot was expected to have discovered the VG.

Running vgchange -ay changed nothing. Trying to make the md a PV, both implicitly using vgcreate and explicitly using pvcreate failed. Here's the last run:
Code:
root@vmhost:~# pvcreate -vv /dev/md127
    DEGRADED MODE. Incomplete RAID LVs will be processed.
...
      /dev/md127: size is 0 sectors
...
      devices/filter not found in config file: no regex filter installed
What to try next?

The gory details

The Debian 8 Jessie 64-bit server was running normally.

It had been installed with EFI boot disabled in the BIOS but the BIOS did not detect the HDDs until EFI BIOS was enabled (we have this situation on at least two Intel motherboard servers).

There were two 1 TB HDDs, formatted GPT. The first partitions were used for md0 which provided /boot. The second were used for md1 which provided the LVM PV.

One of the HDDs generated a few SMART errors. It was removed but the manufacturer's test software found no defects. It was refitted (that was probably a mistake. When one of a mirrored pair starts going bad but not in ways that make md remove it from the array, it may cause file system corruption. Your views?). The SMART errors increased. It was removed. The server would not boot, reporting it could not find the LV for the root file system. Puzzlement.

The defective HDD was refitted. The sever booted. The md devices were using only partitions from the defective HDD. Perhaps md had detected discrepancies and dropped the wrong underlying devices from the array.

The partitions from the good HDD were manually added back to the array. When synchronisation finished, the partitions from the defective HDD were removed from the array.

The replacement 1 TB HDD arrived, was fitted, partitioned and added to the md arrays. Trying to install GRUB generated multiple error messages including "/usr/sbin/grub-probe: error: disk `mduuid/af598d16317f889bd7975cb97d51ad19' not found". Using GNU parted and running "set 1 bios_grub on" on both sda and sdb allowed GRUB to install normally. IDK what "set 1 bios_grub on" does (!) but it made the server bootable without the defective HDD.

The defective HDD was removed and RMAed.

A temporary replacement 3 TB HDD was fitted and its partitions added to the md devices.

The replacement HDD arrived and was fitted but the server would not boot, complaining again about not being able to find the root LV. Puzzlement.

In an effort to clean up this mess, the OS was installed to the replacement HDD as the only HDD connected, this time in EFI mode.

The next step is to recover the data LVs from the old disks. The temporary 3 TB HDD was fitted and ... we are back to the beginning of this story.

Last edited by catkin; 06-15-2015 at 09:40 AM. Reason: Clarification
 
Old 06-15-2015, 10:10 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Did you try vgscan?

Is the partition table on the 3 TB drive dos or gpt? Usually past 2 TB you need gpt but many of these drives come in with dos partition table. (Note "table" here - we're talking about the overall layout of the disk NOT a specific partition's "type" on it - the partition type for the partition.)

Is your LV's PV the metadisk device?
 
Old 06-15-2015, 09:11 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks MensaWater

I did not run vgscan and did so now. It did not find the "foreign" VG.

All partition tables are GPT.

IDK what a "metadisk device" is and searching the 'net did not help. Insofar as each VG (the one from the old system and the one from the new) has a single PV which is an md device and the VG provides the LV for the / file system, then the answer is probably "yes".
 
Old 06-18-2015, 05:45 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Some progress made. In the busybox/ash shell examined /proc/mdstat and found the md devices inactive. Used mdadm to stop them and then to start them (no forcing);
Code:
mdadm --manage --stop /dev/md0
mdadm --assemble --scan /dev/md0
After running lvchange -ay for each LV and exiting the busybox/ash shell, the server booted normally.

The question is now why did the kernel and/or initrd mark the md devices inactive?
 
1 members found this post helpful.
Old 06-18-2015, 06:35 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Fixed by:
Code:
echo BOOT_DEGRADED=true > /etc/initramfs-tools/conf.d/mdadm
update-initramfs -u
The fix was tested on two servers; after the fix both booted normally with one HDD connected.

One of the two servers tested had kernel parameter bootdegraded=true, one did not.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can't access Windows hard disk files with Debian live - disk is mounted Higgsboson Linux - Newbie 8 12-30-2014 02:23 PM
Cannot access files on another disk with an OS on it A Traveller Linux - Newbie 3 09-18-2011 05:30 PM
ntfs-3g cannot access files with foreign characters dissociative Slackware 3 05-11-2008 10:26 PM
Users/Disk Access ? BajaNick Linux - General 13 02-29-2004 08:06 PM
2.6.0 SLOW disk access wayback Linux - Hardware 5 01-15-2004 01:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration