Fedora Linux Support Community & Resources Center
  #16  
Old 3rd March 2013, 01:15 AM
StefanJ Offline
Registered User
 
Join Date: Nov 2006
Posts: 101
linuxfirefox
Re: Trouble Replacing RAID-1 disk

Thanks, I'll try adding the LinuxRAID partition to sbc now.

After entering the output from fdisk, I see where I got the notion of the partitions starting at "4". That was the starting point within the RAID device:

Code:
[root@linuxgame ~]# fdisk -l /dev/md127

Disk /dev/md127: 500.1 GB, 500106639360 bytes
2 heads, 4 sectors/track, 122096347 cylinders, total 976770780 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000fb85

      Device Boot      Start         End      Blocks   Id  System
/dev/md127p1               4     7812495     3906246   82  Linux swap / Solaris
/dev/md127p2         7812496    19531247     5859376   83  Linux
/dev/md127p3        19531248    21484375      976564   83  Linux
/dev/md127p4        21484376   976770775   477643200   83  Linux


---------- Post added at 05:15 PM ---------- Previous post was at 04:46 PM ----------

Well, this is frustrating.

I created a partition table. Went back into parted to create an unformatted partition with the same boundaries as the disk:

Code:
[root@linuxgame ~]# parted /dev/sdc
GNU Parted 3.0
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA ST500DM002-1BD14 (scsi)
Disk /dev/sdc: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart primary 34  976773134                                     
Error: The location 976773134 is outside of the device /dev/sdc.
gparted shows "total sectors" for this drive as: 976773168

Characteristics of the two drives is the same according to device information.

Last edited by StefanJ; 3rd March 2013 at 01:29 AM.
Reply With Quote
  #17  
Old 4th March 2013, 12:06 AM
chrismurphy Offline
Registered User
 
Join Date: May 2010
Posts: 867
macoschrome
Re: Trouble Replacing RAID-1 disk

Quote:
Originally Posted by StefanJ View Post
Partition Table: gpt
Change the partition table type to MBR. parted's term for this is msdos disklabel. GPT has a backup header and table at the end of the disk, and that's probably preventing you from defining the full range you need. MBR is only at the beginning of the disk.
Reply With Quote
  #18  
Old 4th March 2013, 04:08 AM
StefanJ Offline
Registered User
 
Join Date: Nov 2006
Posts: 101
linuxfirefox
Re: Trouble Replacing RAID-1 disk

Gave that a shot:

Code:
root@linuxgame ~]# parted /dev/sdc
GNU Parted 3.0
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) mklabel msdos
Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk
will be lost. Do you want to continue?
Yes/No? y                                                                 

(parted) print
Model: ATA ST500DM002-1BD14 (scsi)
Disk /dev/sdc: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags

(parted) mkpart primary 34  976773134   
Error: The location 976773134 is outside of the device /dev/sdc.
Hah . . .HAH! Got it, I think.
Quote:
(parted) unit s
(parted) mkpart primary 34 976773134
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? y
parted: invalid token: y
Ignore/Cancel? ignore
(parted) print
Model: ATA ST500DM002-1BD14 (scsi)
Disk /dev/sdc: 976773168s
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number Start End Size Type File system Flags
1 34s 976773134s 976773101s primary
Hmmm, the Red Hat "Disk Utility" warns that "The paritiion is misaligned by 3072 bytes. This may result in poor performance."

I am not sure what to try next.

Thanks for continueing hel p . .

Last edited by StefanJ; 4th March 2013 at 04:15 AM.
Reply With Quote
  #19  
Old 5th March 2013, 02:36 AM
chrismurphy Offline
Registered User
 
Join Date: May 2010
Posts: 867
macoschrome
Re: Trouble Replacing RAID-1 disk

Quote:
Originally Posted by StefanJ View Post
Sector size (logical/physical): 512B/4096B

Hmmm, the Red Hat "Disk Utility" warns that "The paritiion is misaligned by 3072 bytes. This may result in poor performance."

I am not sure what to try next.
You have a disk with a 4K physical sector size, so the warning is correct. A start LBA is not aligned to 4K, and will cause excessive RMW by the disk firmware. So start the partition at an LBA divisible by 8. For example 32. That's 2 logical sectors fewer than the original start, so you also need to subtract 2 from your original end sector value, in order to have the same number of (logical) sectors for the two members in the array.
Reply With Quote
  #20  
Old 5th March 2013, 03:52 AM
StefanJ Offline
Registered User
 
Join Date: Nov 2006
Posts: 101
linuxfirefox
Re: Trouble Replacing RAID-1 disk

Hre is a comparison of old and new drives:
Code:
[root@linuxgame ~]# parted /dev/sda
GNU Parted 3.0                                                                            
Using /dev/sda                                                                            
Welcome to GNU Parted! Type 'help' to view a list of commands.                            
(parted) print                                                                            
Model: ATA ST3500410AS (scsi)                                                             
Disk /dev/sda: 500GB                                                                      
Sector size (logical/physical): 512B/512B                                                 
Partition Table: gpt                                                                      
                                                                                          
Number  Start   End    Size   File system  Name             Flags                         
 1      17.4kB  500GB  500GB               RAID: LinuxRAID  raid                          
                                                                                          
(parted) unit s
(parted) print
Model: ATA ST3500410AS (scsi)                                                             
Disk /dev/sda: 976773168s                                                                 
Sector size (logical/physical): 512B/512B                                                 
Partition Table: gpt                                                                      

Number  Start  End         Size        File system  Name             Flags
 1      34s    976773134s  976773101s               RAID: LinuxRAID  raid

(parted) quit                                                             
[root@linuxgame ~]# parted /dev/sdc
GNU Parted 3.0
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s                                                           
(parted) print                                                            
Model: ATA ST500DM002-1BD14 (scsi)
Disk /dev/sdc: 976773168s
Sector size (logical/physical): 512B/4096B
Partition Table: msdos

Number  Start  End         Size        Type     File system  Flags
 1      34s    976773132s  976773099s  primary
The sizes, in sectors, don't quite match.

I added the "raid" flag after capturing the above.

"Disk Utility" still won't let me add sdc as a spare to the raid; it doesn't show up as an available drive.

Thank you for your help and patience.
Reply With Quote
  #21  
Old 6th March 2013, 05:35 AM
chrismurphy Offline
Registered User
 
Join Date: May 2010
Posts: 867
macoschrome
Re: Trouble Replacing RAID-1 disk

Quote:
Originally Posted by StefanJ View Post
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 34s 976773134s 976773101s RAID: LinuxRAID raid


Disk /dev/sdc: 976773168s
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Number Start End Size Type File system Flags
1 34s 976773132s 976773099s primary
The reason you're still having a problem is because you didn't change the start to 32 like I suggested.

But actually, this doesn't matter, you have too many problems here really to proceed in an ideal fashion. Is this a BIOS or UEFI computer? sda is currently GPT with a partition that starts on LBA 34, which is an old parted and fdisk starting value. I really don't think Fedora 16's fdisk or parted used that value but it's been a while since I've done an F16 install.

Further it's weird that sda's partition scheme is GPT, but the partition scheme within the array is MBR. To my knowledge, F16's anaconda produced mirrored bootable installs by partitioning the disks identically first, and then creating separate arrays from those partitions; not creating a partitionable array. So this is not a standard installation.

Next, you have swap on the mirrored array. This is not a good idea because the md driver doesn't keep swap mirrored identically, so if you do a scrub, mismatches will be found due to swap being mirrored, and that taints your results because you won't know if all of the mismatches are due to swap or if you have actual legitimate mismatches, which indicates a problem.

So I personally recommend you just do a backup (or two) of whatever you care about, and then reinstall either F17 or F18 while creating a new mirrored array. This will setup the partitioning correctly, instead of something I've helped you bandaid together that ultimately isn't ideal. Ergo, if either drive fails, you should still have a bootable system, and that can't happen now because the only value you can choose that's 4K aligned for the new disk makes the MBR gap too small to fit GRUB into, and that means if sda dies, you can't boot the computer from sdc.

Last, don't forget to check the SCT ERC of both your drives:
Code:
smartctl -l scterc /dev/sd[ac]
If disabled, you need a startup script that sets these to something like 70 deciseconds. That way the drive gives up on error correction before the linux SCSI layer times out. When the drive reports a read error, the md driver will get the data from the other drive, and most likely fix the bad sector causing the original read problem. This is a per disk setting.

If unsupported, you'll need to change the SCSI layer block device timeout. This is also per device, and needs to be set at startup time.
Code:
echo 130 >/sys/block/sdX/device/timeout
That will change it from the default of 30 seconds, to 2 minutes 10 seconds, which is at least 10 seconds longer than the 1.5 to 2 minute drive timeout of a typical consumer drive that doesn't support settable SCT ERC.

Last edited by chrismurphy; 6th March 2013 at 05:46 AM.
Reply With Quote
  #22  
Old 6th March 2013, 06:10 AM
StefanJ Offline
Registered User
 
Join Date: Nov 2006
Posts: 101
linuxfirefox
Re: Trouble Replacing RAID-1 disk

I'm fairly sure I installed under F16, but I don't remember the steps I took to create the RAID.

The sda drive has been around for quite a while; it may have been formatted for use on a MythTV system I built when Fedora Core 7 was still au courant!

I've been resigned to doing a new install for a few days now. It will be far easier to do that and copy my media files back on.

I had put swap on the RAID because I didn't want it on the SSD boot drive. Putting it on sdb will probably shorten its life, but the system has enough memory that it shouldn't swap too often.

Thanks for your help!

(Ironically, I spent the day torturing the RAIDs of the clustered video server systems I do QA on. All the partitioning is automagically done behind the scenes when a drive is hot-swapped in, so I never see operations on this level.)
Reply With Quote
Reply

Tags
disk, raid1, replacing, trouble

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
replacing dead disk in lvm daytooner Using Fedora 2 5th July 2010 01:40 AM
LVM help replacing disk with larger disk Doug G Using Fedora 5 11th October 2006 08:48 AM


Current GMT-time: 13:29 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat