LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-17-2006, 12:17 PM   #16
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46

Mateo1041: You should be able to modify the CHS geometry on sdb to match sda using fdisk. Then you should be able to format sdb to match sda.

fdisk -C 4427 -H 255 -S 63 /dev/sdb

Also, if all else fails, you can always use fdisk to manually create the needed partition structure on sdb.


See: #man fdisk
 
Old 01-17-2006, 04:38 PM   #17
CrackHarday
LQ Newbie
 
Registered: Jan 2006
Posts: 9

Rep: Reputation: 0
Yeah I see.

I appologize for not having read your posting carefully.

I will come up with a step by step instruction for the 1st part of your problem tomorrow. Hope this is fast enought.

It's late I'll go to bed now ....
 
Old 01-17-2006, 08:04 PM   #18
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
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.
 
Old 01-18-2006, 05:11 PM   #19
CrackHarday
LQ Newbie
 
Registered: Jan 2006
Posts: 9

Rep: Reputation: 0
Forget Windows - its a mess !!

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.

Good luck and best wishes!
 
Old 01-18-2006, 06:53 PM   #20
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
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.
 
Old 01-18-2006, 10:27 PM   #21
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
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.

- Matt.
 
Old 01-19-2006, 04:18 AM   #22
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
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.
 
Old 01-19-2006, 09:51 AM   #23
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
Thanks for the helpful suggestions.

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.

Last edited by Mateo1041; 01-19-2006 at 09:54 AM.
 
Old 01-19-2006, 11:51 AM   #24
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
Quote:
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.
 
Old 01-19-2006, 11:56 AM   #25
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
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.

I believe this inherited server is from 2001.
 
Old 01-19-2006, 12:49 PM   #26
CrackHarday
LQ Newbie
 
Registered: Jan 2006
Posts: 9

Rep: Reputation: 0
@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.
 
Old 01-19-2006, 12:56 PM   #27
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by CrackHarday
@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.
 
Old 01-19-2006, 01:07 PM   #28
CrackHarday
LQ Newbie
 
Registered: Jan 2006
Posts: 9

Rep: Reputation: 0
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.
 
Old 01-19-2006, 01:08 PM   #29
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
CrackHarday: You’re right about the SCSI vs ATA CHS. I forgot the drives were SCSI.
 
Old 01-19-2006, 01:19 PM   #30
Mateo1041
Member
 
Registered: Nov 2004
Location: New Prague, MN
Posts: 80

Original Poster
Rep: Reputation: 15
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.
 
  


Reply



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
Mounting Hard Drives In Ubuntu MSBeckman Linux - Hardware 8 03-13-2005 07:41 PM
Help Mounting Hard Drives on Ubuntu! MSBeckman Linux - Newbie 3 03-13-2005 05:37 PM
RAID, hard drives, etc mrmike Linux - Newbie 0 10-09-2004 04:08 PM
Upgrading hard drives on Software raid 1 boot drives. linuxboy123 Linux - General 0 12-11-2003 03:28 PM
Dual Boot with RAID and Two Hard Drives MoePhish Linux - Hardware 16 04-13-2003 02:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 12:50 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
Open Source Consulting | Domain Registration