Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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.
# 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
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:
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.
# 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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.