I have two 35 GB hard-drives with Ubuntu installed. How to set up RAID?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Does fdisk get rid of the RAID? I just spent an hour trying to get rid of the stupid thing and it just won't go away. I've heard of fdisk and sfdisk...but they make it super complicated to figure either out.
I can't mdadm --manage --remove anything becuase the deviceor resource is busy.
Argh, I wonder if RAID in Windows is easier... I appreciate everyone's help, but this is a lost cause.
It is ok that you can't re"mdadm" this device because it is mounted - especially if it is root.
All right (everything that follows is at own risc - I think it will work - but remember: own risk) :
Step 1: Boot your computer with the UBUNTU install cd
Step 2: use fdisk to reset the partition identifier to LINUX <- this should help you to get rid of this "RAID-thing"
code : [root@henry: /]# fdisk /dev/sda
then type 't' - you will be prompted for the partition number,
so type '1' - you will be prompted for the HEX code,
type '83' for Linux Partition and repeat for partition 5,7,8
now your system is stand alone without RAID.
Step 3: use the command WhatsHisName gave to you to make sure both disks are on same geometry.
code: [root@henry: /]# fdisk -C 4427 -H 255 -S 63 /dev/sdb
Step 4: start again with this Debian administration article and do this procedure only to the RAID autodetect partitions and everything should work fine with your RAID.
I normally use cfdisk because fdisk is buggy when listing partitions and calculating the geometry of the hard drive.
Changing partition types and changing the whole entire partition table does not actually erase data that is on the drive.
What I read that booting from a RAID-1 is a little tricky because grub can only access a non-RAID drive. It is better to put /boot on a non-RAID partition.
Ok, I finally managed to get rid of RAID by changing partitions to 83 on sda and completely deleting all partitions on sdb.
When I try using the "fdisk -C 4427 -H 255 -S 63 /dev/sdb" command and hit "w" to write to disk, it doesn't save anything...even after rebooting. How can I get both geometries to be equal? This is the output I'm getting:
Code:
mbaerbock@Shepherd:~$ sudo fdisk -C 4427 -H 255 -S 63 /dev/sdb
The number of cylinders for this disk is set to 4427.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
mbaerbock@Shepherd:~$ sudo sfdisk -l /dev/sda
Disk /dev/sda: 4427 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 29 30- 240943+ 83 Linux
/dev/sda2 30 4426 4397 35318902+ 5 Extended
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 30+ 637 608- 4883728+ 83 Linux
/dev/sda6 638+ 819 182- 1461883+ 82 Linux swap / Solaris
/dev/sda7 820+ 941 122- 979933+ 83 Linux
/dev/sda8 942+ 4426 3485- 27993231 83 Linux
mbaerbock@Shepherd:~$ sudo sfdisk -l /dev/sdb
Disk /dev/sdb: 34732 cylinders, 64 heads, 32 sectors/track
Units = cylinders of 1048576 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sdb1 0 - 0 0 0 Empty
/dev/sdb2 0 - 0 0 0 Empty
/dev/sdb3 0 - 0 0 0 Empty
/dev/sdb4 0 - 0 0 0 Empty
Any ideas?
I did try cfdisk, but got the following fatal error:
Code:
mbaerbock@Shepherd:~$ cfdisk /dev/sdb
FATAL ERROR: Cannot open disk drive
Press any key to exit cfdisk
Thanks everyone for your help so far. This is just frustrating.
Hard drives are fixed at a certain cylinder, head, and sector, so you can not change it. You can make an image file and specify any cylinder, head, and sector you want, but it will not be easy to set it up to boot up. The howto at http://www.debian-administration.org/articles/238 will not work for your setup because what they are trying to do is copy the partition table to another drive that is the same model and brand. In your case, you have two drives with different geometries, so you can not use sfdisk to copy the partition table. You have to manually make partitions that are similar in size for each drive. On one of the drives, you will lose space. Do not copy what it is done in the Debian article. Improvise the information for your setup. You should not have any empty spots. The extended partition should be the fourth partition not the second partition.
I do not know about you, but the message:
[quote}
The number of cylinders for this disk is set to 4427.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
[/quote]
will worry me. Number two will worry me even more than 1.
I suggest starting creating partitions with the smaller drive and then move on to the larger drive. The larger drive should have enough space.
It is normal that cfdisk will give you errors for sdb and may be sda because you have an invalid partition table. You can run cfdisk with the -z option.
Both hard-drives should be the same size though: 36.4 GB.
You mention the message worries you. What can I do to fix this problem?
If reformatting and reinstalling is what it takes, I'm not opposed to reinstalling Ubuntu Linux as I haven't done too much customizing yet.
So you are saying follow the article, but make sure both drive partitions are the same first? My primary concern is that the hard-drives are in good working order and that they won't give me hardware trouble later on. Based on what I've seen, I don't see that as being true.
Hard drives are fixed at a certain cylinder, head, and sector, so you can not change it...
Before logical addressing, that was true, but it isn’t true with modern drives.
With logical addressing, CHS doesn’t have the same physical relationship to the drive as it did in the old days. What you are setting through fdisk is the Logical CHS, whereas in the old days, we were dealing with the Physical CHS.
You can specify almost any reasonable combinations for CHS, as long as you don’t exceed the drive’s physical capacity, but it’s typically set to H=255 and S=63.
Is there a reason mine doesn't seem to want to save the suggested changes? I typed the "sudo fdisk -C 4427 -H 255 -S 63 /dev/sdb" command in and then hit "w" to save. But when I view my partitions with sfdisk or reboot, everything reverts back to the way it was again.
@Electro/WhatsHisName: You both are right an wrong in some points. It's the different handling of SCSI and S/P ATA. It's a long story and if there is someone who is interested make a new thread.
@Mateo1041: Seems that you did it at least?? Wonderful. Are you running a second OS on this RAID machine ?? If not you don't have to worry about this message. It is only a notifier.
@Mateo1041: Seems that you did it at least?? Wonderful. Are you running a second OS on this RAID machine ?? If not you don't have to worry about this message. It is only a notifier.
Well, I did manage to remove RAID, but I still can't get both hard-drives to have the same geometry so I can actually get RAID working per the article. It just won't save when I type the command suggested elsewhere in this thread. Can they still be RAIDed without the same geometry as long as they still have the same partitions in the same sizes?
No, I'm just running Linux as this is meant to be a server machine.
Sorry I can't figure it out why your machine doesn't want to save the changes.
Probably it don't work because you're not logged in as root - you should try thios fdsik-thing as root - it could help.
2nd. As I sat up my RAID5 a two years ago I went through the changing of the drive params step by step using fdisk and it worked without any problem. I suggest to just type 'fdisk/dev/sdb' and alter the values by hand. You will find these settings in the 'x'tended menu of fdisk.
I thought using "sudo" was the same as being root. But I'll try it and see what happens. Hopefully just changing the partitions numbers will be enough if I still can't get the geometries to be equal.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.