LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-07-2013, 12:19 AM   #1
wwipro
LQ Newbie
 
Registered: Jun 2011
Posts: 29

Rep: Reputation: Disabled
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
 
Old 04-08-2013, 05:45 AM   #2
hurryi
Member
 
Registered: Apr 2010
Distribution: RHEL
Posts: 77

Rep: Reputation: 7
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&
 
Old 04-08-2013, 08:46 PM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
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.
 
Old 04-12-2013, 05:13 PM   #4
wwipro
LQ Newbie
 
Registered: Jun 2011
Posts: 29

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-28-2013, 02:35 PM   #5
wroom
Member
 
Registered: Dec 2009
Location: Sweden
Posts: 91

Rep: Reputation: 24
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.
 
Old 05-03-2013, 09:49 AM   #6
flirek
LQ Newbie
 
Registered: Sep 2011
Posts: 9

Rep: Reputation: Disabled
Quote:
Originally Posted by wwipro View Post
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.
 
Old 05-06-2013, 05:09 AM   #7
cociugcristina
LQ Newbie
 
Registered: Aug 2003
Location: romania
Posts: 8

Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Creating Mirror of existing Volume in Linux rahulruns Linux - General 2 09-18-2009 10:39 AM
mirror root volume group chlawren Linux - Hardware 1 03-14-2007 01:02 PM
installing on slackware 11.0 and can't partition my SAS 5 mirror volume set backthefup Slackware 0 12-09-2006 02:38 PM
Mirror the root disk fayez Linux - Hardware 1 08-23-2005 06:32 PM
Creating root mirror vanibhat Linux - Hardware 2 11-29-2004 09:34 AM


All times are GMT -5. The time now is 11:21 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration