LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   CentOS 5.7 partition problem -- VolGroup00 removed, 2nd HDD ... (https://www.linuxquestions.org/questions/linux-server-73/centos-5-7-partition-problem-volgroup00-removed-2nd-hdd-920299/)

oneclick 12-24-2011 12:39 AM

CentOS 5.7 partition problem -- VolGroup00 removed, 2nd HDD ...
 
Dear All:

Unfortunately I had to re-install CentOS 5.7 because the server was hacked. The CentOS installer demanded during the reinstall to "remove volume group VolGroup00" in order to be able to re-format and re-partition the FIRST (main) hard drive. I did that. The SECOND HDD which had been "VolGroup01" was not re-formatted during the OS reinstall (it holds the backup data)--and it was mounted as /backup before and had only one partition. However, after CentOS was installed on the primary drive, now "fdisk -l" does NOT show me "/dev/sdb1" but a 2nd drive without partition table:
------
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table
------

Anyone know if I really messed it up, or if not, how to mount that 2nd HDD again to recover my backups? (Because that's were the backups are.)


Also, here is how /etc/fstab looked BEFORE the reinstall of the OS on the primary drive.

-----------------
LABEL=/ / ext3 defaults,usrquota 1 1
LABEL=/backup /backup ext3 defaults,usrquota 1 2
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/usr /usr ext3 defaults,usrquota 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs noexec,nosuid 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-sda5 swap swap defaults 0 0
/tmp /var/tmp ext3 defaults,bind,noauto 0 0
-----------------

Thanks!

Bertil

syg00 12-24-2011 01:20 AM

With luck you had that pv on the whole volume rather than a partition. What does "pvs" return.

oneclick 12-24-2011 01:24 AM

pvs ? Nothing at all, no error, just nothing:

[root@serv5 ~]# pvs
[root@serv5 ~]#

I suppose that is a command for a script that CentOS 5.x does not install by default?

---------- EDIT ------

I like to add that the OS was originally installed using 'Cobbler' (remote installer), and in the install script we have:
#set $vgname = "VolGroup00"
#set $vgbackupname = "VolGroup01"
So yes, must have been on both HDDs, and on the whole HDDs rather than the partition (as HDD1 had several partitions).
.... But *I* did not write that, and unfortunately I do know nothing about volume groups and how to deal with the current problem (and how I could have avoided it).

Bertil

syg00 12-24-2011 03:10 AM

Just saw that edit.
pvs is a LVM subcommand (try "man lvm"). Rather than lead you astray, let me go set up a LVM system and try some things. Will take some time (as Christmas eve is coming to a close here) - hopefully someone who actually likes LVM and has more experience will step in first.

oneclick 12-24-2011 03:38 AM

Oh yes, Australia ... I am here in Italy right now, still in the morning.
Merry Christmas to you!

I see that I can use Webmin to "Add a new volume group" (LVM) -- but am rather scared that this would overwrite whatever might be there.


Best,
Bertil

oneclick 12-24-2011 06:32 AM

In another forum I found the following suggestion for a simlar problem:

-------------
From the description sounds like there was only 1 partition, and if LVM
is it use, it would have been type 8e; so, just recreating the partition
with fdisk, using the entire disk, and setting the type to 8e seems like
a good bet.
-------------

I did exactly this.
But after doing this my main problem is now to mount this LVM volume. It is unbelievable complicated. I see several websites explaining it, but nothing seems to work because other than that 2nd HDD there is no LVM system.

In any case ... it seems it did not work ... output for "pvs" command is:
PSize: 298 GB, PFree 298 GB
That means the disk is empty.

Any data recovery software you can suggest --that can be installed remotely on the 1st main disk?



Bertil

syg00 12-24-2011 08:16 PM

Try "pvscan" and see what pops up.

oneclick 12-25-2011 06:09 AM

Again thank you for the reply and suggestion.
Finally I was able to get a solution: I used the recovery script "TestDisk" (http://www.cgsecurity.org/wiki/TestDisk) and that worked for me -- I could recover the backup folder.

The main lesson learned though, for me at least, is to never again use "LVM" (Logical Volume Manager) as a partition system ... that just creates too many problems once a disk has to be replaced or reformatted.

Thanks again for your time and suggestions.


Bertil


All times are GMT -5. The time now is 08:19 AM.