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.
I want to setup Raid 1 Mirroring on my Linux version 9.0 server. I have two WD 200 GIG drives and all the software to do this. I have read several papers on how to do this. I guess I need to get past this one point.
I have one drive configured and loaded with my OS and the partitions are laid out the way that I want. I have the other drive setup with the same partitions but of a type of Linux Raid Autodetect. Here is my problem. When I change the drive that is loaded with the software from a type of linux native (83) to Linux Raid Autodetect (fd) the following happens. When I go to define the raid devices I only see the drive with no data on it and type of linux Raid Autodetect. How do I do it to get it to work correctly.
=====
Current:
Hda type Hdd type
/dev/hda1 83 /dev/hdd1 fd
/dev/hda2 83 /dev/hdd2 fd
/dev/hda3 83 /dev/hdd3 fd
/dev/hdd4 swap /dev/hdd4 fd
When I go in to create the raid device it only shows me the hdd device and nothing on the hda side even when I use fdisk and change the type to fd. Can anyone help me?
Below you will find the fdisk configuration I am working with. Here is what I want to do. I want to make the hda one mirrored to hdd. They are both the same exact drive types. I have mdadm and have issued the command to create a raid level 1 with the two drives but got the following message.
error - mdadm - invalid number of raid devices =2
1. Since I have the hda device laid out the way I want it, do I need to change the ID type of each partition to fd?
2. What would I have to do to hdd to make it the mirror? Do I need to setup the whole drive as id FD?
3. Can I issue the mdadm command as follows to create the raid device and have it mirror the whole drive?
Dude, you're missing the point of RAID if that's what you're doing? RAID is designed to make multiple partitions/disks function as a single. If you want to make both disks bootable you aren't trying to make a RAID
I understand what mirrorring is and how it works. I am just having a problem with the setup. I only want to make them both bootable from the standpoint of if one disk dies the other will work and take over and if the system is rebooted for any reason with the one disk down it will come back up. Does that make sense?
I don't want to use raid 5. I want to use raid 1. I only have two drives. Raid 1 would allow some redundancy and the ability for a drive to die and us to still function until we get another drive.
You need to partition your hdd exactly the same way as your hda. Your RAID intended partitions must be set to fd. Each drive should have a /boot partition with the boot flag set. This means that If you want to have a 10GB /usr partition, you'll want to setup /dev/hda2 and /dev/hdd2 to be 5GB each with partition types of fd. Or whatever.
Your /etc/raidtab file needs to be configured along the lines of:
You posted before I finfished. RAID 1 will not allow you to access your data in case of drive failure without replacing the drive and rebuilding the array.
To be honest, You don't need dual swap space. You just need to figure out how many RAID partitions you need between the two disks and make sure the partitions on each drive reflect that. If you need 3 RAID devices, then you set it all up so you have three partitions on each drive that match in size, one for one.
You change the partition type with fdisk from the fdisk commandline. The t option will allow you to choosed the fd type. You do realize you are changing the types of the partitions, not the disk right?
Finally, once you start the RAID devices, they are seen by Linux as a single device/partition. It is this device/partition that you format. You don't format the partitions on each drive. You format them as a single RAID device! As long as you run it on the device (/dev/md0) or whatever, it is not damaging to anything.
This is what I have from and fdisk stand point. Notice the type f and 82 on hda. Do I need to ceate those on hdd also and should they be setup as linux raid autodetect?
=====
[root@area51test ftp]# fdisk -l
Disk /dev/hdd: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdd1 * 1 1912 15358108+ fd Linux raid autodetect
/dev/hdd2 1913 11473 76798732+ fd Linux raid autodetect
/dev/hdd3 11474 17847 51199155 fd Linux raid autodetect
Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1912 15358108+ fd Linux raid autodetect
/dev/hda2 1913 11473 76798732+ fd Linux raid autodetect
/dev/hda3 11474 17847 51199155 fd Linux raid autodetect
/dev/hda4 17848 24321 52002405 f Win95 Ext'd (LBA)
/dev/hda5 17848 19122 10241406 82 Linux swap
[root@area51test ftp]#
This is my raidtab file. You can see how it relates to the fdisk -l settings. Let me know if you see anything wrong or that won't work. Thanks.
=====
raiddev /dev/md0
raid-level 1
nr-raid-disks 2
chunk-size 64
persistent-superblock 1
#nr-spare-disks 0
device /dev/hda1
raid-disk 0
device /dev/hdd1
raid-disk 1
I can't be sure, but I don't think you want to RAID your /boot partition. If hda1 is your boot partition, then I think you should start the partitions that you want to RAID on hda2. Other than that, everything looks okay to me. Admittedly, I'm looking at this while I'm trying to do work so I can get paid, but a cursory glance looks about right.
As usual, there are more questions as you get closer to finishing.
I have the following.
1. I am trying to do mkraid /dev/md1 and /dev/md2. This will mirror everything from my first drive to the second except the swap file which I understand is not necessary to mirror. I get the following error message when I try it.
error - /var device is busy.
I tried to do a umount /var and it says that it is successful but it still shows busy.
I assume that you cannot mount a device while processes are still running. How can I successfully umount each of the other partitions that I want to create raid devices for?
2. Once that is done do I then do a mkefs on the md0, md1 and md2 so that they are formatted?
3. Last I have read about a utility called mdadm which allows you to create and manage raid devices. Is this useful or should I stick with mkraid and the other tools?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.