LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-03-2016, 08:22 PM   #16
r00tk1ll
LQ Newbie
 
Registered: Apr 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled

Ok I finally made it to this point:

Quote:
Back in #11, I gave the command for copying the image back to the new drive. Then you can assemble the array, unlock the encryption, and run lvscan to find the LVM logical volumes.
Now when I run lvscan I get this:

Code:
  WARNING: Device for PV 2PT2Kv-403c-iO2B-kKAY-B4uV-aMaI-1mlSQI not found or rejected by a filter.
  inactive          '/dev/VolGroup00/LogVol00' [5.45 TiB] inherit
  inactive          '/dev/VolGroup00/LogVol01' [5.41 GiB] inherit
Is this saying I'm missing a drive? I have all 7 drives, connected back the way it was.

vgscan gives this:

Code:
  Reading all physical volumes.  This may take a while...
  WARNING: Device for PV 2PT2Kv-403c-iO2B-kKAY-B4uV-aMaI-1mlSQI not found or rejected by a filter.
  WARNING: Device for PV 2PT2Kv-403c-iO2B-kKAY-B4uV-aMaI-1mlSQI not found or rejected by a filter.
  Found volume group "VolGroup00" using metadata type lvm2
fdisk -l gives this:

Code:
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes, 1953525168 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: 0x0002db59

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      208844      104391   83  Linux
/dev/sda2          208845  1953520064   976655610   8e  Linux LVM

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes, 1953525168 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: 0x00016492

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63  1953520064   976760001   8e  Linux LVM

Disk /dev/sdf: 1000.2 GB, 1000204886016 bytes, 1953525168 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: 0x000baca0

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1   *          63  1953520064   976760001   8e  Linux LVM

Disk /dev/sde: 1000.2 GB, 1000204886016 bytes, 1953525168 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: 0x000088fa

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1   *          63  1953520064   976760001   8e  Linux LVM

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes, 1953525168 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: 0x0003f54f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *          63  1953520064   976760001   8e  Linux LVM

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes, 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x0003b67a

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *          63  1953520064   976760001   8e  Linux LVM
Partition 1 does not start on physical sector boundary.

Disk /dev/sdg: 1000.2 GB, 1000204886016 bytes, 1953525168 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/live-rw: 8589 MB, 8589934592 bytes, 16777216 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/live-base: 8589 MB, 8589934592 bytes, 16777216 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/live-osimg-min: 8589 MB, 8589934592 bytes, 16777216 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/luks-a6382836-5a73-42c6-ad78-ee5d4d701c7c: 1000.2 GB, 1000201712640 bytes, 1953518970 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/luks-61681fae-c55b-4d79-ada1-ce7ca497cfb5: 1000.2 GB, 1000201712640 bytes, 1953518970 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/luks-25db43f5-fa88-4ab8-8568-0e439e1b62df: 1000.2 GB, 1000201712640 bytes, 1953518970 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Alignment offset: 512 bytes


Disk /dev/mapper/luks-6eada242-6252-4b48-8e0e-cb3f9d737062: 1000.2 GB, 1000201712640 bytes, 1953518970 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/luks-bce272a9-0ad7-4297-afb0-fa7482cacd91: 1000.2 GB, 1000201712640 bytes, 1953518970 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
So what is going on here? I don't want to move forward without understanding what the problem may be,
Thanks
 
Old 05-03-2016, 08:41 PM   #17
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
You never posted the final status from ddrescue. Are there still unrecovered sectors (blocks with a status flag other than "+" in the log file)?

Did the array assemble OK? What is the content of /proc/mdstat?

I can't figure out what is where from what you have posted. With things in the same state as they were for the above posting, please post the output from lsblk.
 
1 members found this post helpful.
Old 05-03-2016, 08:58 PM   #18
r00tk1ll
LQ Newbie
 
Registered: Apr 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Right, I'm sorry I forgot to post it, here is the log from the ddrescue operation:

Quote:
# Rescue Logfile. Created by GNU ddrescue version 1.18.1
# Command line: ddrescue -n -N -vvv /dev/sdd /mnt/win/sdd.img /mnt/win/sdd.log
# Start time: 2016-05-03 02:16:47
# Current time: 2016-05-03 02:16:47
# Finished
# current_pos current_status
0xE8E0DB0000 +
# pos size status
0x00000000 0xE8E0DB6000 +

cat /proc/mdstat shows:
Quote:
Personalities :
unused devices: <none>
lsblk shows:
Quote:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
ââsda1 8:1 0 102M 0 part
ââsda2 8:2 0 931.4G 0 part
sdb 8:16 0 931.5G 0 disk
ââsdb1 8:17 0 931.5G 0 part
ââluks-a6382836-5a73-42c6-ad78-ee5d4d701c7c
253:3 0 931.5G 0 crypt
sdc 8:32 0 931.5G 0 disk
ââsdc1 8:33 0 931.5G 0 part
ââluks-61681fae-c55b-4d79-ada1-ce7ca497cfb5
253:4 0 931.5G 0 crypt
sdd 8:48 0 931.5G 0 disk
ââsdd1 8:49 0 931.5G 0 part
ââluks-25db43f5-fa88-4ab8-8568-0e439e1b62df
253:5 0 931.5G 0 crypt
sde 8:64 0 931.5G 0 disk
ââsde1 8:65 0 931.5G 0 part
ââluks-6eada242-6252-4b48-8e0e-cb3f9d737062
253:6 0 931.5G 0 crypt
sdf 8:80 0 931.5G 0 disk
ââsdf1 8:81 0 931.5G 0 part
ââluks-bce272a9-0ad7-4297-afb0-fa7482cacd91
253:7 0 931.5G 0 crypt
sdg 8:96 0 931.5G 0 disk
sr0 11:0 1 696M 0 rom /run/initramfs/live
loop0 7:0 0 20K 1 loop
loop1 7:1 0 4.2M 1 loop
ââlive-osimg-min 253:2 0 8G 1 dm
loop2 7:2 0 626.1M 1 loop
loop3 7:3 0 8G 1 loop
ââlive-rw 253:0 0 8G 0 dm /
ââlive-base 253:1 0 8G 1 dm
ââlive-osimg-min 253:2 0 8G 1 dm
loop4 7:4 0 512M 0 loop
ââlive-rw 253:0 0 8G 0 dm /
 
Old 05-03-2016, 11:11 PM   #19
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
So ddrescue was able to recover the entire content of the drive. That is good.

I now see 5 partitions identified as LUKS containers, not just the single LUKS partition in your post back in #10. That pokes holes in my theory at that time that your partitions were all elements of a RAID-0 array that was encrypted as a single unit.

To see what you might have, I set up a VM with 7 disks and did a CentOS 6 minimal install, telling the installer to use all space and encrypt the system. It appears that sda2 should have been shown as a LUKS partition, and there should also be a partition sdg1 that is LUKS. You can run "file -s /dev/sda2" to verify that lsblk just didn't show that for some reason, but where is partition sdg1? I'm guessing that is your missing LVM PV.

Try running testdisk on /dev/sdg and see if it identifies a LUKS partition. It won't get the size right (LUKS containers don't indicate their size), but should get the starting location right. Assuming that testdisk identifies the LUKS container, you'll need to use fdisk to delete and re-create the partition with the correct starting location and extending to the end of the disk. Hopefully, that will clean things up, but do NOT try to write out a partition table until you verify that the LUKS container does not start at the beginning of the unpartitioned disk. That would damage the LUKS header and make that drive forever unrecoverable. In fact, save the first 5 megabytes of that drive somewhere before messing with it.

There is one other problem you'll run into. The new sdd drive has a 4K physical sector size, and its partition is not properly aligned for that. It should work that way, but with very bad write performance. Lets get things working first, and cross that bridge when we come to it.

Last edited by rknichols; 05-03-2016 at 11:15 PM.
 
2 members found this post helpful.
Old 05-03-2016, 11:46 PM   #20
r00tk1ll
LQ Newbie
 
Registered: Apr 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Thanks a million, but first how do I specify the first 5 MBs of a drive?

Quote:
In fact, save the first 5 megabytes of that drive somewhere before messing with it.
 
Old 05-04-2016, 08:10 AM   #21
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Code:
dd if=/dev/sdg bs=1M count=5 of=/path/to/some/file.img
 
1 members found this post helpful.
Old 05-04-2016, 07:12 PM   #22
r00tk1ll
LQ Newbie
 
Registered: Apr 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Ok, it looks like the the live CD wasn't seeing the partitions properly, I rebooted and now this is where I'm at.

I backed up the first five MB of /dev/sdg like this:

Quote:
dd if=/dev/sdg bs=1M count=5 of=/mnt/win.sdg.img

file -s /dev/sda2 show this:

Quote:
/dev/sda2: LUKS encrypted file, ver 1 [aes, cbc-essiv:sha256, sha1] UUID: c14cbc68-546e-4449-ae95-50cab20c22c8
So I see that it says LUKS so I ran lsblk again and got this:

Quote:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
ââsda1 8:1 0 102M 0 part
ââsda2 8:2 0 931.4G 0 part
ââluks-c14cbc68-546e-4449-ae95-50cab20c22c8
253:8 0 931.4G 0 crypt
ââVolGroup00-LogVol00 253:9 0 5.5T 0 lvm
ââVolGroup00-LogVol01 253:10 0 5.4G 0 lvm
sdb 8:16 0 931.5G 0 disk
ââsdb1 8:17 0 931.5G 0 part
ââluks-a6382836-5a73-42c6-ad78-ee5d4d701c7c
253:3 0 931.5G 0 crypt
ââVolGroup00-LogVol00 253:9 0 5.5T 0 lvm
sdc 8:32 0 931.5G 0 disk
ââsdc1 8:33 0 931.5G 0 part
ââluks-61681fae-c55b-4d79-ada1-ce7ca497cfb5
253:4 0 931.5G 0 crypt
ââVolGroup00-LogVol00 253:9 0 5.5T 0 lvm
sdd 8:48 0 931.5G 0 disk
ââsdd1 8:49 0 931.5G 0 part
ââluks-25db43f5-fa88-4ab8-8568-0e439e1b62df
253:5 0 931.5G 0 crypt
ââVolGroup00-LogVol00 253:9 0 5.5T 0 lvm
sde 8:64 0 931.5G 0 disk
ââsde1 8:65 0 931.5G 0 part
ââluks-6eada242-6252-4b48-8e0e-cb3f9d737062
253:6 0 931.5G 0 crypt
ââVolGroup00-LogVol00 253:9 0 5.5T 0 lvm
sdf 8:80 0 931.5G 0 disk
ââsdf1 8:81 0 931.5G 0 part
ââluks-bce272a9-0ad7-4297-afb0-fa7482cacd91
253:7 0 931.5G 0 crypt
ââVolGroup00-LogVol00 253:9 0 5.5T 0 lvm
sdg 8:96 0 931.5G 0 disk
sdh 8:112 0 1.8T 0 disk
ââsdh1 8:113 0 100M 0 part
ââsdh2 8:114 0 1.8T 0 part /mnt/win
sr0 11:0 1 696M 0 rom /run/initramfs/live
loop0 7:0 0 20K 1 loop
loop1 7:1 0 4.2M 1 loop
ââlive-osimg-min 253:2 0 8G 1 dm
loop2 7:2 0 626.1M 1 loop
loop3 7:3 0 8G 1 loop
ââlive-rw 253:0 0 8G 0 dm /
ââlive-base 253:1 0 8G 1 dm
ââlive-osimg-min 253:2 0 8G 1 dm
loop4 7:4 0 512M 0 loop
ââlive-rw 253:0 0 8G 0 dm /

So I see it say LUKS again on sda2, so now I moved on and ran testdisk on /dev/sdg like this:

Quote:
#testdisk /dev/sdg
I choose
>[Intel] Intel/Pc Partition
>[Analyse]

It says Partition sector doesn't have the endmark 0xAA55

Then
>[Quick Search]

After it scans it shows nothing but:
Disk /dev/sdg - 1000 GB / 931 GiB - CHS 121601 255 63
Partition Start End Size in sectors
So maybe when the OS was installed the 7th drive (sdg) was never included in the LVG?

lvscan now shows:

Quote:
ACTIVE '/dev/VolGroup00/LogVol00' [5.45 TiB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [5.41 GiB] inherit
If this is the case, would it be safe to move forward and try to mount the Logical Volume and extract the data?

Thanks
 
Old 05-04-2016, 07:49 PM   #23
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Since LVM seems to be happy with the volume group, you can try mounting /dev/VolGroup00/LogVol00 and /dev/VolGroup00/LogVol01 read-only and see what's there. An alternative would be first to try running "fsck -f -n /dev/VolGroup00/LogVol00", but if that is not an ext4 filesystem it's going to take a huge amount of time to check even if the filesystem is mostly empty. An fsck of /dev/VolGroup00/LogVol01 would not take nearly as long. Of course if LogVol01 is your swap space there is nothing to check there.

You should take a look at sdg and see what is in there. Since it looks like you can only account for about 6TiB of space, it might be totally unused. Running "hexedit -s /dev/sdg" and looking at the first few sectors, a few sectors starting with sector 64, and a few starting with sector 2048 might be informative.

Once you have everything working and figure out what sdg is (or isn't), the next issue will be the partition alignment on sdd.

Last edited by rknichols; 05-04-2016 at 08:04 PM. Reason: Add comment about LogVol01
 
1 members found this post helpful.
Old 05-04-2016, 08:15 PM   #24
r00tk1ll
LQ Newbie
 
Registered: Apr 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Awesome rknichols!

I was able to mount /dev/VolGroup00/LogVol00 in read only and it appears all the files I needed from /var/www/html are there, they have just been moved into the /lost+found directory.

I have no idea why sdg is even in there, but if I can get the /var/www/html files copied to an external drive than that was all I needed to accomplish.

If you don't see any problems with copying these files to the external drive, I will do that and report back.
 
Old 05-04-2016, 08:45 PM   #25
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
You should be good to go, then. I get the feeling you're not very interested in the rest of that system. If you do have any further questions, check back in.
 
Old 05-04-2016, 09:19 PM   #26
r00tk1ll
LQ Newbie
 
Registered: Apr 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
First and foremost, I want to thank you and syg00 for your expert advice. The problem was definitely out of my area of expertise. I am glad to report that all of the files are recovered as far as I can tell, I will be going through them but it looks like a 100% success rate.

As far as the OS goes I really don't mind wiping it out and finding a better strategy than the previous one. I hope this thread will help someone out in the future if they ever run into a similar problem.

Thanks Again
 
Old 05-04-2016, 09:26 PM   #27
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,145

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Don't thank me - I stayed out of it so as to not confuse things.
Make sure you click the "did you find this helpful" on a couple of @rknichols posts to boost reputation.
 
Old 05-04-2016, 09:41 PM   #28
r00tk1ll
LQ Newbie
 
Registered: Apr 2016
Posts: 14

Original Poster
Rep: Reputation: Disabled
Yup, No problem
 
Old 05-05-2016, 08:46 AM   #29
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by r00tk1ll View Post
As far as the OS goes I really don't mind wiping it out and finding a better strategy than the previous one.
Note that spreading a single filesystem across multiple disk drives with no redundancy is a recipie for the sort of problem you experienced. If any drive fails, you lose access to everything.
 
  


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
help mounting drive that has redhat volume group to copy data ron7000 Linux - General 5 10-29-2015 06:37 PM
LVM Mount Physical Volume/Logical Volume without a working Volume Group mpivintis Linux - Newbie 10 01-11-2014 07:02 AM
Extended LVM Volume group and Logical Volume. But space not usable linuxlover.chaitanya Linux - Server 1 11-19-2012 09:37 AM
I have spce in volume group but it can not increase the size of logical volume anis123 Linux - Newbie 14 04-16-2012 06:23 AM
[SOLVED] Redhat volume group,logical volume group dhairysheel Red Hat 3 08-02-2011 05:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:52 PM.

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