LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-01-2008, 07:21 PM   #1
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Rep: Reputation: 37
How to access Mirror Drive?


Hi Keen Duds!

how to access the Mirror Drive?

I mirrored my 2pcs of 500G HDD. How to access the other drive?
Iam using LVM.
 
Old 12-01-2008, 08:08 PM   #2
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
How to boot from the Second Mirror Drive?

Hi Keen Buddies,

How to boot from the Second Mirror Drive? I want to check if the other drive of mine is working coz I have problem now in LVMGRoup.
thanks
 
Old 12-01-2008, 09:56 PM   #3
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
Your question is a little vague.

Are you mirroring two two partitions with software RAID (md - the Multiple Device driver)?
If so, you would never want to access either drive individually as it would corrupt the array.
Instead you need to access the "md" device that represents the software RAID array. You can do
a 'cat /proc/mdstat' command to show you the name(s) of the "md" device(s) and what underlying
devices each array is comprised of. Here is a example of using two partitions to create a RAID1
(mirror) array:

# cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : active raid1 sda2[0] sdb2[1]
25005056 blocks [2/2] [UU]

The first array is named /dev/md0; the second, /dev/md1; etc.

For reference, here are the two underlying partitions, /dev/sda2 and /dev/sdb2:

# fdisk -l /dev/sda

Disk /dev/sda: 1500.3 GB, 1500300828160 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0002a7c0

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3126 25005172+ fd Linux raid autodetect

# fdisk -l /dev/sdb

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00031558

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 3126 25005172+ fd Linux raid autodetect


An 'md' device can be added to LVM just like a regular partition -- pcreate; vgcreate or vgextend;
then lvcreate the logical volumes within the volume group.

Here is what LVM looks like after the pvcreate / vgcreate / lvcreate.

# pvs
PV VG Fmt Attr PSize PFree
/dev/md0 vg00 lvm2 a- 23.84G 32.00M

# vgs
VG #PV #LV #SN Attr VSize VFree
vg00 1 2 0 wz--n- 23.84G 32.00M

# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
lv00 vg00 -wi-ao 1.00G
lv01 vg00 -wi-ao 22.81G


And how the logical volumes are mounted:

# mount
/dev/mapper/vg00-lv01 on / type ext3 (rw)
[Ed. entries removed for brevity.]
/dev/sda1 on /boot type ext3 (rw)
/dev/sdb1 on /boot2 type ext3 (rw)
[Ed. more entries removed for brevity.]

]# swapon -s
Filename Type Size Used Priority
/dev/mapper/vg00-lv00 partition 1048568 0 -1
 
Old 12-01-2008, 10:22 PM   #4
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by tommylovell View Post
Your question is a little vague.

Are you mirroring two two partitions with software RAID (md - the Multiple Device driver)?
If so, you would never want to access either drive individually as it would corrupt the array.
Instead you need to access the "md" device that represents the software RAID array. You can do
a 'cat /proc/mdstat' command to show you the name(s) of the "md" device(s) and what underlying
devices each array is comprised of. Here is a example of using two partitions to create a RAID1
(mirror) array:

# cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4]
md0 : active raid1 sda2[0] sdb2[1]
25005056 blocks [2/2] [UU]

The first array is named /dev/md0; the second, /dev/md1; etc.

For reference, here are the two underlying partitions, /dev/sda2 and /dev/sdb2:

# fdisk -l /dev/sda

Disk /dev/sda: 1500.3 GB, 1500300828160 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0002a7c0

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 3126 25005172+ fd Linux raid autodetect

# fdisk -l /dev/sdb

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00031558

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 3126 25005172+ fd Linux raid autodetect


An 'md' device can be added to LVM just like a regular partition -- pcreate; vgcreate or vgextend;
then lvcreate the logical volumes within the volume group.

Here is what LVM looks like after the pvcreate / vgcreate / lvcreate.

# pvs
PV VG Fmt Attr PSize PFree
/dev/md0 vg00 lvm2 a- 23.84G 32.00M

# vgs
VG #PV #LV #SN Attr VSize VFree
vg00 1 2 0 wz--n- 23.84G 32.00M

# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
lv00 vg00 -wi-ao 1.00G
lv01 vg00 -wi-ao 22.81G


And how the logical volumes are mounted:

# mount
/dev/mapper/vg00-lv01 on / type ext3 (rw)
[Ed. entries removed for brevity.]
/dev/sda1 on /boot type ext3 (rw)
/dev/sdb1 on /boot2 type ext3 (rw)
[Ed. more entries removed for brevity.]

]# swapon -s
Filename Type Size Used Priority
/dev/mapper/vg00-lv00 partition 1048568 0 -1
thank you i will try later. I am using RHEL4
 
Old 12-01-2008, 11:52 PM   #5
aus9
LQ Guru
 
Registered: Oct 2003
Distribution: Fedora 25 Gnome (Wayland)
Posts: 5,132

Rep: Reputation: Disabled
which bootloader is in first drive?

if grub just boot a live cd and try
Code:
grub
root (hd1,x)
setup (hd1)
quit
where x is the /boot partition or partition where /boot folder is .....counting from zero as per tutorial

assumes you have a mirrored /boot on drive 2 (hd1)
 
Old 12-02-2008, 12:07 AM   #6
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by aus9 View Post
which bootloader is in first drive?

if grub just boot a live cd and try
Code:
grub
root (hd1,x)
setup (hd1)
quit
where x is the /boot partition or partition where /boot folder is .....counting from zero as per tutorial

assumes you have a mirrored /boot on drive 2 (hd1)

Just for additional info sorry I am lock of information on top. I am using LVM Integrated Mirror not Integrated Stripping....

I use RAID 1. thnx
 
Old 12-02-2008, 11:22 AM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
merged the dupes ... your behaviour on the boards is
.... ummm ... rather unorthodox. Please revisit the
rules you agreed to ...
 
Old 12-02-2008, 06:38 PM   #8
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Original Poster
Rep: Reputation: 37
Quote:
Originally Posted by Tinkster View Post
merged the dupes ... your behaviour on the boards is
.... ummm ... rather unorthodox. Please revisit the
rules you agreed to ...
thanks for the reminder dude.
 
  


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
Mirror to SATA drive Penn Linux - Server 1 11-05-2008 07:29 AM
what is the best way to mirror a hard drive. neu2linux General 8 11-02-2007 05:00 PM
Drive Mirror Me jfinnican Linux - Hardware 5 06-14-2006 09:26 PM
Adding a second drive for mirror msaitta Linux - General 1 11-09-2004 04:55 PM
How to mirror a drive? _TK_ Linux - General 1 05-12-2003 05:17 PM


All times are GMT -5. The time now is 04:49 AM.

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