LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to mirror root volume? (https://www.linuxquestions.org/questions/linux-server-73/how-to-mirror-root-volume-4175457191/)

wwipro 04-07-2013 12:19 AM

How to mirror root volume?
 
Hello:

Current O/S is build on disk /dev/cciss/c0d0: 146.8 GB,
Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 * 1 51 204800 83 Linux
/dev/cciss/c0d0p2 51 35132 143132672 8e Linux LVM
# pvdisplay
--- Physical volume ---
PV Name /dev/cciss/c0d0p2
VG Name vg0
Current logical volumes:
/dev/mapper/vg0-LogVol00 /
/dev/mapper/vg0-LogVol01 /usr
/dev/mapper/vg0-LogVol02 /var
/dev/mapper/vg0-LogVol03 /usr/local
/dev/mapper/vg0-LogVol04 /opt
/dev/mapper/vg0-LogVol05 swap

Add second disk, same model. Duplicated partition from c0d0 to c0d1:
Disk /dev/cciss/c0d1: 146.8 GB
Device Boot Start End Blocks Id System
/dev/cciss/c0d1p1 1 51 204987 83 Linux
/dev/cciss/c0d1p2 51 35132 143131648 83 Linux

How do I mirror all those logical volumes and /boot? How do I make the 2nd mirror member c0d1 bootable?
Thanks

hurryi 04-08-2013 05:45 AM

I assume you would have to make a raid1 at the hp smart array controller config

though i have no info about the current setup
you have 2 logical drives but i dont know if they are currently in what raid lvl?
if you are lucky then its degraded raid1 then you would just need to delete the 2nd array and give the disk to the 1st

I think you could even do that online with hpacucli (i never did that personally but i think its possible)

do you have hpacucli tool installed?

http://h20000.www2.hp.com/bizsupport...&idx=1&mode=4&

chrism01 04-08-2013 08:46 PM

If you've got hp smart array controller, then normally RAIDing is handled as HW raid, so you just have to plug in the new disk and it'll auto-magically mirror it.
ie the RAID is invisible to the normal OS, but see next sentence.
You certainly should get the PSP (product-support-pkg) from HP and install it as it contains all the tools you'll need, inc hpacucli.

wwipro 04-12-2013 05:13 PM

Hi,
It is a HP Proliant box, has Smart RAID Array. I also installed hpacucli. The hardware RAID-1 works fine.
I like to know if a box does not equip with such RAID controller, so, hardware RAID is not available. How to do software based mirror by using LVM?
I assume i could build logical volumes and use lvcovert command to mirror each lv. Then, how to make the 2nd device bootable?
Thanks.

wroom 04-28-2013 02:35 PM

I guess you have all the data one one 146 GB drive? And that drive is not configured as any raid?
And that you want to add another USCSC320 146 GB drive and have the same data hardware mirrored on two drives?

In that case i would do like this: I would back the current drive (the whole drive as it is) to an externally attached USB drive, like a SATA drive in a USB adapter or something like that. Either i would copy the drive by a USB bootstick Clonezilla, or with any other USB or CD live linux system and just backup the drive raw with dd. The key is that i do the image copy of the drive "in system" and that i don't clone the bare drive externally.

When i feel sure i got a good and restorable copy of the entire drive in a backup, then i would reconfigure the HP SmartArray adapter to do a mirror raid on the two disks, and start restoring the old data to the newly created HW mirror raid. You can start restoring before the raid has synched the two drives. But if you want to be extremely safe, then you should let the array sync before restoring. (I havent yet had a failure because of writing to a raid that has not yet synced, but then i always verify the restored contents at the end).

The new mirror drive will appear the same to the system as the old drive did as /dev/cciss/c0d0 with the partitions (in your case) /dev/cciss/c0d0p1 and /dev/cciss/c0d0p2.

The only difference being up to twice the read speed and the safety of a two disk mirror raid.

And you should always make an image backup when changing a raid system. Many strange things can happen on the way, and all the data will be gone from the raid. Like, for example, if you mistake the identity of the new drive and the old drive with the data when you tell the raid controller to sync up a mirror and preserving data. It will wipe it.

And keep in mind that a HW raid controller keeps track of a drive being a raid member or not by means of either or both of UUID block on the drives and/or NVRAM configuration data in the controller. So one cannot expect the raid controller to preserve the old data when resyncing a drive that was not previously in a raid. So better make sure, make an image backup before changing the raid.


The Proliant USCSI320 HW raid is pretty good, although the adapters tend to surge in bandwidth with raid sets bigger than three drives. Best i have got from a Proliant DL380 is two stripe raid sets with three drives each in paralell, with one raid member on one scsi bus and two on the other bus, for each raid set. Then you get nearly three times the drives individual bandwith (about 270 MB/s, linear, read or write).
Setting up a six drive stripe and the speed plummets down to that of a single drive. Not sure why.

flirek 05-03-2013 09:49 AM

Quote:

Originally Posted by wwipro (Post 4930554)
Hi,
It is a HP Proliant box, has Smart RAID Array. I also installed hpacucli. The hardware RAID-1 works fine.
I like to know if a box does not equip with such RAID controller, so, hardware RAID is not available. How to do software based mirror by using LVM?
I assume i could build logical volumes and use lvcovert command to mirror each lv. Then, how to make the 2nd device bootable?
Thanks.

i have one server which using Linux SoftRaid, and that is without LVM2. and boot&root partition are simple mirrors.

i use this lines in lilo.conf to ensure that both disks are bootable:
boot = /dev/md1
raid-extra-boot= mbr <----- important!!
image = /boot/k3.5.7
root = /dev/md0

i using partition type "fd" for auto-detect, and SoftRaid support is build-in in kernel (not module).

work for years without problem.

cociugcristina 05-06-2013 05:09 AM

As long as data have to be cloned, you can spend for 2 new HDD and activate miroring on HW level; with no outhage if these are hot swap;
Then you can clone with clonezila or dd: mbr; /boot /all_logical_volumes and reboot server from raid. Outage is minimal and risc to loose data, too.


All times are GMT -5. The time now is 10:43 PM.