On Friday 22 June 2007 17:40, Lorenzo Cerini wrote:
> Hi all,
> i have a little trouble with a software raid1 array.
> i built it with opensuse10.0.
>
> Now one disks left the array giving me the (F) of failure for one
> partition. here is the cat /proc/mdstat:
>
>  Personalities : [raid1]
> md1 : active raid1 sda3[0]
>       129017920 blocks [2/1] [U_]
>
> md0 : active raid1 sdb1[2](F) sda1[0]
>       26217984 blocks [2/1] [U_]
>
> I ma quite far from this server location, so i need to know:
> how much fair is to assume disks is not broker and just use 'badblocks -f'?
>
> and if i want to replace it which is the easiest way ?
> i partition here the new disk (maybe with fdisk, but do not know the
> way to have the disk raid formatted with id=fd), replace the old one,
> and then use raidhotadd, or, if the new disk will get anyway the /dev/sdb
> identifier, the kernel will do it for me at boot time.

Hello Lorenzo,
It seems like your raid arrays are in a pretty bad state.
/dev/md1 is broken, and /dev/md0 is too.

Here's a suggestion on how to troubleshoot it:
1. If you have some important data on that server, back it up first to a safe 
location other than the above mentioned server. Using scp, rsync, anything.
2. You can try to build the array one by one:
For /dev/md1:
mdadm /dev/md1 -a /dev/sdb3 (assuming the broken pair is sdb3)

For /dev/md0:
Remove the F member first:
mdadm /dev/md0 -r /dev/sdb1
Add it again:
mdadm /dev/md0 -a /dev/sdb1

For preparing the new disk, please take note the current partition scheme from 
the server, fdisk -l /dev/sda, fdisk -l /dev/sdb. You must make the partition 
on the new disk EXACTLY like the real one.
Then partition Using fdisk, for example sdb:
fdisk /dev/sdb
n (new)
primary partition (1-4)
First cylinder: (just enter)
Last cylinder: +1000M (1GB)
Repeat for other partitions.

Then, change the type of the partition as software raid:
t
L (for list of codes)
fd (software raid)
Repeat for other partitions

w (save)

--------------
I have the following note for the actual menu, attached as text file, 
hopefully it can go through the list.

Remember, backup your data first! Keep save.
HTH,
-- 
Fajar Priyanto | Reg'd Linux User #327841 | Linux tutorial 
http://linux2.arinet.org
6:23pm up 5:51, 2.6.18.2-34-default GNU/Linux 
Let's use OpenOffice. http://www.openoffice.org
[EMAIL PROTECTED] ~]# fdisk /dev/hda

The number of cylinders for this disk is set to 4865.
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): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1           2       16033+  83  Linux
/dev/hda2               3        1177     9438187+  83  Linux
/dev/hda3            1178        1488     2498107+  83  Linux
/dev/hda4            1489        4865    27125752+   5  Extended
/dev/hda5            1489        1814     2618563+  83  Linux
/dev/hda6            1815        1945     1052226   83  Linux
/dev/hda7            1946        2059      915673+  82  Linux swap
/dev/hda8            2060        2075      128488+  83  Linux
/dev/hda9            2076        2792     5759271   83  Linux
/dev/hda10           2793        3002     1686793+  83  Linux
/dev/hda11           3003        4829    14675346   83  Linux
/dev/hda12           4830        4832       24066   83  Linux

Command (m for help): v
539838 unallocated sectors

Command (m for help): n
First cylinder (4833-4865, default 4833): 
Using default value 4833
Last cylinder or +size or +sizeM or +sizeK (4833-4865, default 4865): +50M

Command (m for help): p

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1           2       16033+  83  Linux
/dev/hda2               3        1177     9438187+  83  Linux
/dev/hda3            1178        1488     2498107+  83  Linux
/dev/hda4            1489        4865    27125752+   5  Extended
/dev/hda5            1489        1814     2618563+  83  Linux
/dev/hda6            1815        1945     1052226   83  Linux
/dev/hda7            1946        2059      915673+  82  Linux swap
/dev/hda8            2060        2075      128488+  83  Linux
/dev/hda9            2076        2792     5759271   83  Linux
/dev/hda10           2793        3002     1686793+  83  Linux
/dev/hda11           3003        4829    14675346   83  Linux
/dev/hda12           4830        4832       24066   83  Linux
/dev/hda13           4833        4839       56196   83  Linux

Command (m for help): n
First cylinder (4840-4865, default 4840): 
Using default value 4840
Last cylinder or +size or +sizeM or +sizeK (4840-4865, default 4865): +50M

Command (m for help): p

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1           2       16033+  83  Linux
/dev/hda2               3        1177     9438187+  83  Linux
/dev/hda3            1178        1488     2498107+  83  Linux
/dev/hda4            1489        4865    27125752+   5  Extended
/dev/hda5            1489        1814     2618563+  83  Linux
/dev/hda6            1815        1945     1052226   83  Linux
/dev/hda7            1946        2059      915673+  82  Linux swap
/dev/hda8            2060        2075      128488+  83  Linux
/dev/hda9            2076        2792     5759271   83  Linux
/dev/hda10           2793        3002     1686793+  83  Linux
/dev/hda11           3003        4829    14675346   83  Linux
/dev/hda12           4830        4832       24066   83  Linux
/dev/hda13           4833        4839       56196   83  Linux
/dev/hda14           4840        4846       56196   83  Linux

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): t
Partition number (1-14): 13
Hex code (type L to list codes): L

 0  Empty           1e  Hidden W95 FAT1 75  PC/IX           be  Solaris boot   
 1  FAT12           24  NEC DOS         80  Old Minix       bf  Solaris        
 2  XENIX root      39  Plan 9          81  Minix / old Lin c1  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  82  Linux swap      c4  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     83  Linux           c6  DRDOS/sec (FAT-
 5  Extended        41  PPC PReP Boot   84  OS/2 hidden C:  c7  Syrinx         
 6  FAT16           42  SFS             85  Linux extended  da  Non-FS data    
 7  HPFS/NTFS       4d  QNX4.x          86  NTFS volume set db  CP/M / CTOS / .
 8  AIX             4e  QNX4.x 2nd part 87  NTFS volume set de  Dell Utility   
 9  AIX bootable    4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt         
 a  OS/2 Boot Manag 50  OnTrack DM      93  Amoeba          e1  DOS access     
 b  W95 FAT32       51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O        
 c  W95 FAT32 (LBA) 52  CP/M            9f  BSD/OS          e4  SpeedStor      
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs        
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  EFI GPT        
10  OPUS            55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/
11  Hidden FAT12    56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b
12  Compaq diagnost 5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor      
14  Hidden FAT16 <3 61  SpeedStor       a9  NetBSD          f4  SpeedStor      
16  Hidden FAT16    63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary  
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fd  Linux raid auto
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fe  LANstep        
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid ff  BBT            
1c  Hidden W95 FAT3
Hex code (type L to list codes): fd
Changed system type of partition 13 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1           2       16033+  83  Linux
/dev/hda2               3        1177     9438187+  83  Linux
/dev/hda3            1178        1488     2498107+  83  Linux
/dev/hda4            1489        4865    27125752+   5  Extended
/dev/hda5            1489        1814     2618563+  83  Linux
/dev/hda6            1815        1945     1052226   83  Linux
/dev/hda7            1946        2059      915673+  82  Linux swap
/dev/hda8            2060        2075      128488+  83  Linux
/dev/hda9            2076        2792     5759271   83  Linux
/dev/hda10           2793        3002     1686793+  83  Linux
/dev/hda11           3003        4829    14675346   83  Linux
/dev/hda12           4830        4832       24066   83  Linux
/dev/hda13           4833        4839       56196   fd  Linux raid autodetect
/dev/hda14           4840        4846       56196   83  Linux

Command (m for help): 
Command (m for help): t   
Partition number (1-14): 14
Hex code (type L to list codes): fd
Changed system type of partition 14 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1           2       16033+  83  Linux
/dev/hda2               3        1177     9438187+  83  Linux
/dev/hda3            1178        1488     2498107+  83  Linux
/dev/hda4            1489        4865    27125752+   5  Extended
/dev/hda5            1489        1814     2618563+  83  Linux
/dev/hda6            1815        1945     1052226   83  Linux
/dev/hda7            1946        2059      915673+  82  Linux swap
/dev/hda8            2060        2075      128488+  83  Linux
/dev/hda9            2076        2792     5759271   83  Linux
/dev/hda10           2793        3002     1686793+  83  Linux
/dev/hda11           3003        4829    14675346   83  Linux
/dev/hda12           4830        4832       24066   83  Linux
/dev/hda13           4833        4839       56196   fd  Linux raid autodetect
/dev/hda14           4840        4846       56196   fd  Linux raid autodetect

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or 
resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[EMAIL PROTECTED] ~]# cat /proc/partitions 
major minor  #blocks  name

   3     0   39082680 hda
   3     1      16033 hda1
   3     2    9438187 hda2
   3     3    2498107 hda3
   3     4          1 hda4
   3     5    2618563 hda5
   3     6    1052226 hda6
   3     7     915673 hda7
   3     8     128488 hda8
   3     9    5759271 hda9
   3    10    1686793 hda10
   3    11   14675346 hda11
   3    12      24066 hda12
[EMAIL PROTECTED] ~]# fdisk -l

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1           2       16033+  83  Linux
/dev/hda2               3        1177     9438187+  83  Linux
/dev/hda3            1178        1488     2498107+  83  Linux
/dev/hda4            1489        4865    27125752+   5  Extended
/dev/hda5            1489        1814     2618563+  83  Linux
/dev/hda6            1815        1945     1052226   83  Linux
/dev/hda7            1946        2059      915673+  82  Linux swap
/dev/hda8            2060        2075      128488+  83  Linux
/dev/hda9            2076        2792     5759271   83  Linux
/dev/hda10           2793        3002     1686793+  83  Linux
/dev/hda11           3003        4829    14675346   83  Linux
/dev/hda12           4830        4832       24066   83  Linux
/dev/hda13           4833        4839       56196   fd  Linux raid autodetect
/dev/hda14           4840        4846       56196   fd  Linux raid autodetect
[EMAIL PROTECTED] ~]# partprobe
[EMAIL PROTECTED] ~]# cat /proc/partitions 
major minor  #blocks  name

   3     0   39082680 hda
   3     1      16033 hda1
   3     2    9438187 hda2
   3     3    2498107 hda3
   3     5    2618563 hda5
   3     6    1052226 hda6
   3     7     915673 hda7
   3     8     128488 hda8
   3     9    5759271 hda9
   3    10    1686793 hda10
   3    11   14675346 hda11
   3    12      24066 hda12
   3    13      56196 hda13
   3    14      56196 hda14

Attachment: pgpxn5BiRIgFb.pgp
Description: PGP signature

Reply via email to