Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
I rebuilt a server and am now trying to recover my large data arrays.
The server was ubuntu 10.04lts before.
I decided to rebuild it with CentOS simply because I am more familiar with it.
I had 2 raid-5 arrays on the old server:
4 x 1tb -> md0
5 x 2tb -> md1
The newly built server does not know about these arrays yet. How can I reassemble the arrays without loosing my data?
I know the data can still be accessed because booting the server with a live-cd mounts and shows the arrays just fine.
Should I boot with a live cd and copy the mdadm config file?
Regarding the "...without losing data..." part I recommend ensuring that you have an up to date backup before doing anything else. Mr. Murphy is always looking for an opportunity to mess you up. Since the live CD will assemble the arrays properly you could use that to make your backups if you don't already have them.
Last edited by stress_junkie; 12-11-2010 at 02:31 PM.
Thank you. I gave it a shot and here is what I get:
These are the devices:
Quote:
Disk /dev/sdb: 2000.3 GB, 2000398934016 bytes
Disk /dev/sdc: 2000.3 GB, 2000398934016 bytes
Disk /dev/sdd: 2000.3 GB, 2000398934016 bytes
Disk /dev/sde: 2000.3 GB, 2000398934016 bytes
Disk /dev/sdf: 2000.3 GB, 2000398934016 bytes
Disk /dev/sdg: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdh: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdi: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdj: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdb: 2000.3 GB, 2000398934016 bytes
Disk /dev/sdc: 2000.3 GB, 2000398934016 bytes
Disk /dev/sdd: 2000.3 GB, 2000398934016 bytes
Disk /dev/sde: 2000.3 GB, 2000398934016 bytes
Disk /dev/sdf: 2000.3 GB, 2000398934016 bytes
Disk /dev/sdg: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdh: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdi: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdj: 1000.2 GB, 1000204886016 bytes
Here is the return from dmraid -ay:
Quote:
dmraid -ay
ddf1: virtual drives with CRC 466DCCE2, expected 866C0109 on /dev/sda
ddf1: physical drives with CRC EA982444, expected 8A877121 on /dev/sda
ddf1: VD CFG with CRC F4AB4282, expected 981107F1 on /dev/sda
ddf1: VD CFG with CRC EA90F2, expected ECF124FA on /dev/sda
ERROR: ddf1: cannot find virtual drive record on /dev/sda
ERROR: ddf1: wrong # of devices in RAID set "ddf1_SYSTEM" [1/4] on /dev/sda
RAID set "ddf1_SYSTEM" already active
The dynamic shared library "libdmraid-events-ddf1.so" could not be loaded:
libdmraid-events-ddf1.so: cannot open shared object file: No such file or directory
ERROR: dos: reading /dev/mapper/ddf1_SYSTEM[No such device or address]
ERROR: ddf1: cannot find virtual drive record on /dev/sda
Before doing anything, you gotta make sure all previous RAID metadata is erased from disk. "dmraid remove_all" does not erase it.
The DDF1 array stores metadata at the end of the hard drive. One way to erase it is to zero out the entire hard drive, but that could take too much time depending on size.
Another way, is to find out where the metadata is stored. You can do this in Linux by running "strace dmraid -c -s > /tmp/out 2>&1". Look at the output file for "lseek" which will give you the byte offset of the metadata. The metadata is stored in a bunch of different sectors, so "lseek" will appear a bunch of times, just find the smallest byte offset and use "dd" to zero the data from that point forward.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.