1

we had a CentOS 6.4 server with two RAIDs. One RAID-1 and the other RAID-5 RAID-1 had multiple partitions with OS installed on it. RAID-5 had two partitions with some data on it.

In order to replicate a scenario, we had to quash RAID-1 partitions and install CentOS 4.8 on it. We just removed the other RAID during installation. After OS was installed, we re-inserted the disks of RAID-5 into the bays and rebooted the server. we wanted to mount these partitions and use the data on it.

Now the server shows the partitions on device /dev/cciss/c0d1 as /dev/cciss/c0d1p1 and /dev/cciss/c0d1p2 but we are not sure how to mount them and read data from them.

Here are the outputs of some commands

df -h shows all partitions on RAID-1

[root@dbreplica ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/cciss/c0d0p5     9.7G  278M  8.9G   3% /
/dev/cciss/c0d0p1     193M   14M  170M   8% /boot
none                   16G     0   16G   0% /dev/shm
/dev/cciss/c0d0p7     3.9G   40M  3.7G   2% /home
/dev/cciss/c0d0p9      90G   88M   85G   1% /opt
/dev/cciss/c0d0p8     985M   18M  918M   2% /tmp
/dev/cciss/c0d0p3      12G  7.2G  3.8G  66% /usr
/dev/cciss/c0d0p6     3.9G  248M  3.5G   7% /var

fdisk -l shows all partitions on both RAIDs

[root@dbreplica ~]# fdisk -l

Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
255 heads, 32 sectors/track, 35132 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1   *           1          50      203984   83  Linux
/dev/cciss/c0d0p2              51        4066    16385280   82  Linux swap
/dev/cciss/c0d0p3            4067        7078    12288960   83  Linux
/dev/cciss/c0d0p4            7079       35132   114460320    5  Extended
/dev/cciss/c0d0p5            7079        9588    10240784   83  Linux
/dev/cciss/c0d0p6            9589       10592     4096304   83  Linux
/dev/cciss/c0d0p7           10593       11596     4096304   83  Linux
/dev/cciss/c0d0p8           11597       11847     1024064   83  Linux
/dev/cciss/c0d0p9           11848       35132    95002784   83  Linux

Disk /dev/cciss/c0d1: 2400.3 GB, 2400374186496 bytes
255 heads, 63 sectors/track, 291828 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d1p1               1      127483  1024000000   83  Linux
/dev/cciss/c0d1p2          127483      267350  1123482624   83  Linux

But fsck on the RAID-5 partitions give us this error

[root@dbreplica ~]# fsck -t ext3 /dev/cciss/c0d1
fsck 1.35 (28-Feb-2004)
e2fsck 1.35 (28-Feb-2004)
Couldn't find ext2 superblock, trying backup blocks...
fsck.ext3: Bad magic number in super-block while trying to open /dev/cciss/c0d1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

I am not a Linux guru. Just know a few things. Can someone please help how we can get the data read from the two partitions on RAID-5 ?

ThoriumBR
  • 5,272
  • 2
  • 23
  • 34
  • As you said at the beginning, /dev/cciss/c0d1 is the full device, c0d1p1 and c0d1p2 are the partitions. Then you show the output of running fsck on /dev/cciss/c0d1 (which as you know is not a partition). Since filesystems tend to be on partitions, you need to run fsck (**f**ile **s**ystem **c**onsistency chec**k**) against c0d1p1/p2, not the c0d1 device. –  Apr 17 '15 at 19:08
  • 1
    In future you should really use virtual machines. Tearing a server in half like that is just asking for trouble :) – Michael Hampton Apr 17 '15 at 20:16
  • As I was in a hurry to set this machine up, and was lucky to find that I had a backup of the data I wanted to retain, I deleted those partitions on c0d1 and tried to create from scratch. But now I am having trouble creating partitions. c0d1 is of size 2TB and I want to create 2 partitions of 1 TB each. But when I try to specify +1024000M during fdisk -n, it gives me "Value not in range" error – Mubashir Abbas Apr 17 '15 at 21:24

0 Answers0