LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-30-2012, 08:42 PM   #1
chenxiongni
LQ Newbie
 
Registered: Apr 2012
Posts: 12

Rep: Reputation: Disabled
Smile Mirror HDD in redhat 5


Hi,

Firstly, thank you for checking this post.

This might be a very simply question for you guys, but any help will be really appreciated.

We have a Sun X2200M2 server running Redhat 5 with 2 x 250G disk software RAID 1 in production environment.

we want to test some commands in that system which we do not know the impact. so we prefer to mirror the exactly same HDD from that server in to our testing x2200M2 with same hardware environment.

is there a good solution we have do that disk mirror?

again, thank you for the help.

Andy
 
Old 05-30-2012, 09:20 PM   #2
BeerIsGood
LQ Newbie
 
Registered: Aug 2005
Location: Emerald, Queensland, Australia
Distribution: Kubuntu => moving => Debian 6
Posts: 27
Blog Entries: 1

Rep: Reputation: 0
rsync

I think rsync would be best for this. It comes with most distributions. Read the man page for more details, and/or find an online tutorial like this one: http://everythinglinux.org/rsync/.
 
Old 05-30-2012, 09:28 PM   #3
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
you can do it using different tools and command, generally DD command is common for disk imaging or mirrors and works great too. also some tools like partimage can solve your problem.


Using of DD command

Code:
dd if=/dev/HARDDISK-LOGICAL-VOLUME of=/dev/NEW_HARDDISK
you can also take the backup into a image file and than restore on another harddrive.

TO backup into file
Code:
dd if=/dev/HARDDISK-LOGICAL-VOLUME of=/opt/disk-HDD-imagefile
To restore file on another HDD
Code:
dd if=disk-HDD-imagefile-with-path of=/dev/HARDDISK-DISK-DRIVE
more resources for "DD" command

http://www.thegeekstuff.com/2010/10/...mand-examples/

http://www.linuxquestions.org/questi...ommand-362506/


also you can create a disk partition layout and just copy paste all the files from one disk to another disk will work same
you understand it here.
http://linux-sxs.org/administration/mirror_hdd.html



also you can install partimage utility, another powerfull utility for disk mirror, but i believe that it is not shipped with Redhat 5 by default you need to download it and install it.

http://www.debiantutorials.org/back-...ndows-204.html
 
1 members found this post helpful.
Old 05-30-2012, 09:33 PM   #4
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
@ BeerISGood,

rsync will not make HDD bootable, it will not take the backup of MBR so HDD will not boot even after rysnc.
 
Old 05-30-2012, 10:58 PM   #5
chenxiongni
LQ Newbie
 
Registered: Apr 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Hi em31amit,

Thank you for your post. the only question i have now is the x2200 M2 server only has two disk slots which are in used for RAID 1.

so, you mean i need pull out one of disk and insert a new disk in and then run that DD command to mirror the whole disk?

if i pull out one of HDD, would new disk get sync automatically after i insert in? because of raid 1?

sorry, my question may be really sounds stupid. but appreciate your comments.

Andy
 
Old 05-30-2012, 11:20 PM   #6
BeerIsGood
LQ Newbie
 
Registered: Aug 2005
Location: Emerald, Queensland, Australia
Distribution: Kubuntu => moving => Debian 6
Posts: 27
Blog Entries: 1

Rep: Reputation: 0
Quote:
Originally Posted by em31amit View Post
@ BeerISGood,

rsync will not make HDD bootable, it will not take the backup of MBR so HDD will not boot even after rysnc.
Fair enough. I was thinking more of mirroring a file structure than a physical drive. DD is the way.
 
Old 05-30-2012, 11:39 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,362

Rep: Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377
You should check your actual HW, but according to this http://www.solarsystems.com/products...200_m2_server/ that system has hot-swappable disks, so you could pull one out, load a blank, the use the swapped out one to start a new system...
 
1 members found this post helpful.
Old 05-30-2012, 11:44 PM   #8
chenxiongni
LQ Newbie
 
Registered: Apr 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thank you all.

I will give it try.

Andy
 
Old 05-30-2012, 11:57 PM   #9
em31amit
Member
 
Registered: Apr 2012
Location: /root
Distribution: Ubuntu, Redhat, Fedora, CentOS
Posts: 190

Rep: Reputation: 55
are you using software raid or hardware raid on your server, you need to take care of that too and also for hot swapping drive is good way to do, but still you should make sure while hot-swapping drive that you have detach from OS and again rescan when attached, you need to rescan the scsi-bus else os will not show to you into the /dev path and also in fdisk -l output

this is the command to scan scsi bus hdd on rhel5

Code:
echo "- - -" > /sys/class/scsi_host/hostX/scan
 
  


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
How to mirror one hdd to another hdd in linux dkalsaria Red Hat 5 12-21-2008 01:05 PM
Need help on mirror HDD max321 Linux - Newbie 13 07-31-2006 05:04 AM
Help with creating a HDD mirror... ctroyp Linux - Newbie 14 02-02-2006 02:13 PM
how to make mirror image of one hdd to 2 hdd raj_1 General 1 12-02-2004 06:19 PM
How to make mirror image of linux partion to one1 HDD TO 2 HDD raj_1 Linux - General 2 11-04-2004 01:45 AM


All times are GMT -5. The time now is 01:53 PM.

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