LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 03-30-2022, 11:45 AM   #1
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Rep: Reputation: 22
Question CentOS7, software RAID1 and encryption. How to recover some data


I have to ask for help because I do not dare destroy it.
I will not do anything with these disk anymore 'cos I'm too scared of destroying the data i need.


I got 2 disks that was in a CentOS 7Linux software RAID1(mirror) system with my boot system and other partitions.
On one of those extra partitions I got drivers that I need bad.
Although it's CentOS the RAID1 and encryption should be equal with eg. Arch as this is not dependent of the architecture itself (right?)
All the drives except boot and those needed for that are encrypted with a password that I know.
I just replaced these drives with others and installed a fresh Rocky Linux system but I need drivers from these.
As I've understood it a RAID1 system can be broken without damaging the data so it should be(?) possible to fix the data from one of these drives.

As long I can get those drivers from one of these 2 disks, everything is mostly not important.
Although it could be really great to look into some configs that are places in /etc as that also will help out a lot as those are system specific.

As you see one partition got mounted(only from this disk) and asked for the encryption password and that worked, too bad it's not on this one.

If I remember correctly it's on the md127 partition that has the drivers.

If I try to mount the partitions that didn't automount(udiskie) I get this:
Code:
    ┌─[basher52@ArchGamer]~
    └──❯ sudo mount /dev/sdb1 /mnt/1/
    mount: /mnt/1: unknown filesystem type 'linux_raid_member'.
    ┌─[basher52@ArchGamer]~
    └──❯ sudo mount /dev/md127 /mnt/1/
    mount: /mnt/1: can't read superblock on /dev/md127.
but i guess since it's a RAID and and also encrypted I can't just mount these devices, right?

A long time ago when I had disk problems with windows someone told me to clone the partition in question and than work on that, if any error was done I can always use a copy of it.
Is this a plausible here, just to be extra careful so to speak.


Some info:...

FDISK:
Code:
    
    Disk /dev/sdb: 465,76 GiB, 500107862016 bytes, 976773168 sectors
    Disk model: WDC WD5000AAKS-6
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x0005fb04

    Device     Boot     Start       End   Sectors   Size Id Type
    /dev/sdb1            2048 314836991 314834944 150,1G fd Linux raid autodetect
    /dev/sdb2       314836992 440731647 125894656    60G fd Linux raid autodetect
    /dev/sdb3       440731648 545654783 104923136    50G fd Linux raid autodetect
    /dev/sdb4       545654784 976773119 431118336 205,6G  5 Extended
    /dev/sdb5       545656832 650579967 104923136    50G fd Linux raid autodetect
    /dev/sdb6       650582016 755505151 104923136    50G fd Linux raid autodetect
    /dev/sdb7       755507200 860430335 104923136    50G fd Linux raid autodetect
    /dev/sdb8       860432384 876955647  16523264   7,9G fd Linux raid autodetect
    /dev/sdb9  *    876957696 881156095   4198400     2G fd Linux raid autodetect
    /dev/sdb10      881158144 976773119  95614976  45,6G fd Linux raid autodetect
LSBLK:
Code:
    NAME                                  MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
    sda                                     8:0    0 111,8G  0 disk
    ├─sda1                                  8:1    0   500M  0 part
    ├─sda2                                  8:2    0    80G  0 part  /
    └─sda3                                  8:3    0  31,3G  0 part  /home
    sdb                                     8:16   0 465,8G  0 disk
    ├─sdb1                                  8:17   0 150,1G  0 part
    │ └─md127                               9:127  0     0B  0 md
    ├─sdb2                                  8:18   0    60G  0 part
    │ └─md125                               9:125  0     0B  0 md
    ├─sdb3                                  8:19   0    50G  0 part
    │ └─md126                               9:126  0     0B  0 md
    ├─sdb4                                  8:20   0     1K  0 part
    ├─sdb5                                  8:21   0    50G  0 part
    │ └─md123                               9:123  0     0B  0 md
    ├─sdb6                                  8:22   0    50G  0 part
    │ └─md122                               9:122  0     0B  0 md
    ├─sdb7                                  8:23   0    50G  0 part
    │ └─md120                               9:120  0    50G  0 raid1
    │   └─luks-60d002aa-c13d-4161-933e-603b132d4bf0
    │                                     254:0    0    50G  0 crypt /run/media/basher52/aa84fd3c-5568-4aab-a081-1c36723246d7
    ├─sdb8                                  8:24   0   7,9G  0 part
    │ └─md121                               9:121  0     0B  0 md
    ├─sdb9                                  8:25   0     2G  0 part
    │ └─md119                               9:119  0     0B  0 md
    └─sdb10                                 8:26   0  45,6G  0 part
      └─md124                               9:124  0     0B  0 md
    sdc                                     8:32   1     0B  0 disk
    sdd                                     8:48   1     0B  0 disk
    sde                                     8:6
 
Old 03-30-2022, 12:50 PM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
You said
Code:
All the drives except boot and those needed for that are encrypted with a password that I know.
With that said, it seems you already have everything needed.
Raid 1 is mirroring, so it is simple to connect just one of each mirrored drive pair and activate the array. You did not say, but with raid 1 I would assume only 2 drives involved. If using raid 10 or raid 1 with 4 or more drives you would have a much different scenario.

Once the array is activated then by knowing the password you should be able to open and mount the device and read the data needed.

If I am correct that there are only 2 drives in the raid 1 array then connect the one drive and activate it.
A quick search for "linux activate a raid 1 array with 1 drive" gave this as the first link. The instructions seem pretty clear.
 
Old 03-31-2022, 03:14 PM   #3
Basher52
Member
 
Registered: Mar 2004
Location: .SE
Distribution: Arch
Posts: 401

Original Poster
Rep: Reputation: 22
@computersavvy
Well something like that page and that, did the work, but i was scared ass * to trash it.
Took me some hours, just to be sure to not to do anything wrong, as I've done before. Too bad you're not doing this daily so you know it when it's needed :P

Thanks for the answer though.
Had one little problem with this though and that was that the device's partition already was 'connected' to an md-device but it couldn't as I did this on anoither machine, but "mdadm stop" finally released it and made it all work.
 
1 members found this post helpful.
  


Reply

Tags
encryption, raid1, recover data, rockylinux



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
Any problem if I install CENTOS7 Workstation over CENTOS7 Server? Rich Strebendt Linux - Software 5 05-03-2018 11:05 PM
Recover data from raid1 drive denisps Linux - Newbie 5 11-21-2012 04:27 PM
Recover mdadm raid1 data after recreate new array over old Murz Linux - General 2 12-15-2011 05:04 AM
Have software raid1, but like to change to raid1+0 or 0+1, how? spaceuser Debian 8 03-17-2008 02:07 PM
LXer: Recover Data From RAID1 LVM Partitions With Knoppix Linux LiveCD LXer Syndicated Linux News 0 04-24-2007 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:18 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