Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MD Disks - Re: tlug: Thrashed to death



--------------------------------------------------------
tlug note from gaijin@example.com (John Little)
--------------------------------------------------------
% 
% This is one of those "don't do this at home stories". I cobbled
% together several 100mb drives and thought that I'd give the "md"
% device a try. John spoke about this during our Linux on Sparc
% meeting. This lets you combine several drives into on, in various
% ways. 
% 

   ...and I should really have mentioned this, too. I hope it's not too
   late for your disks, Andy. To be honest, I don't know if this already
   fixed in the 2.0.27 and 2.0.29 kernels.

   I know your particular problem wasn't related to this, but if your
   striped disks "go away" after a while, this could be the solution.


-------------------------------------------------------------------------------
> From: "David S. Miller" <davem@example.com>
> Date: Mon, 4 Nov 1996 19:03:01 -0500 (EST)
> Subject: Important note about using RAID

[ We are working on a general solution for this problem,
  but for now the following quick fix will make it work
  for everyone. ]

If certain things aren't setup right, using RAID md facilities on the
Sparc will overwrite your disk labels on every disk in a stripe or
linear partition except for the first one.

Because of this, you need to play with fdisk on the disks you would
like to use with RAID.  Basically you need to make sure every
partition that will be a part of a RAID device starts at least at
cylinder 1 to avoid the label being overwritten.  Here is an example
of what needs to be done:

[root@example.com linux]# fdisk /dev/sde1
Command (m for help): p

Disk /dev/sde1 (Sun disk label): 16 heads, 135 sectors, 3880 cylinders
Units = cylinders of 2160 * 512 bytes

    Device Flag   Begin    Start      End   Blocks   Id  System
/dev/sde11            0        0     3833  4139640   83  Linux native
/dev/sde12  u      3833     3833     3880    50760   82  Linux swap
/dev/sde13            0        0     3880  4190400    5  Whole disk

Command (m for help): d
Partition number (1-8): 1
Command (m for help): n
Partition number (1-8): 1
First cylinder (0-3833): 1
Last cylinder or +size or +sizeM or +sizeK ([1]-3833): 3833
Command (m for help): w
Calling ioctl() to re-read partition table.
Syncing disks.
[root@example.com linux]# fdisk /dev/sdf
Command (m for help): p

Disk /dev/sdf (Sun disk label): 16 heads, 135 sectors, 3880 cylinders
Units = cylinders of 2160 * 512 bytes

   Device Flag   Begin    Start      End   Blocks   Id  System
/dev/sdf1            0        0     3833  4139640   83  Linux native
/dev/sdf2  u      3833     3833     3880    50760   82  Linux swap
/dev/sdf3            0        0     3880  4190400    5  Whole disk

Command (m for help): d
Partition number (1-8): 1
Command (m for help): n
Partition number (1-8): 1
First cylinder (0-3833): 1
Last cylinder or +size or +sizeM or +sizeK ([1]-3833): 3833
Command (m for help): w
Calling ioctl() to re-read partition table.
Syncing disks.

[root@example.com linux]# mdadd /dev/md0 /dev/sde1 /dev/sdf1
[root@example.com linux]# mdrun -p0 /dev/md0
[root@example.com linux]# cat /proc/mdstat
Personalities : [1 linear] [2 raid0]
read_ahead 120 sectors
md0 : active raid0 sde1 sdf1 8277120 blocks 4k chunks
      [z0] 
      z0=[sde1/sdf1] zo=0 do=0 s=8277120
md1 : inactive
md2 : inactive
md3 : inactive
[root@example.com linux]# dd if=/dev/zero of=/dev/md0 count=100
100+0 records in
100+0 records out
[root@example.com linux]# sync
[root@example.com linux]# mdstop /dev/md0
[root@example.com linux]# sync

Now you can take a look at the disks again...

[root@example.com linux]# fdisk /dev/sde

Command (m for help): p

Disk /dev/sde (Sun disk label): 16 heads, 135 sectors, 3880 cylinders
Units = cylinders of 2160 * 512 bytes

   Device Flag   Begin    Start      End   Blocks   Id  System
/dev/sde1            1        1     3833  4138560   83  Linux native
/dev/sde2  u      3833     3833     3880    50760   82  Linux swap
/dev/sde3            0        0     3880  4190400    5  Whole disk

Command (m for help): q
[root@example.com linux]# fdisk /dev/sdf

Command (m for help): p

Disk /dev/sdf (Sun disk label): 16 heads, 135 sectors, 3880 cylinders
Units = cylinders of 2160 * 512 bytes

   Device Flag   Begin    Start      End   Blocks   Id  System
/dev/sdf1            1        1     3833  4138560   83  Linux native
/dev/sdf2  u      3833     3833     3880    50760   82  Linux swap
/dev/sdf3            0        0     3880  4190400    5  Whole disk

Command (m for help): q

And everything is just fine.

--------------------------------------------////
Yow! 10.49 MB/s remote host TCP bandwidth  ////
over 100Mb/s ethernet.  Beat that!        ////
-----------------------------------------////__________  o
David S. Miller, davem@example.com /_____________/ / // /_/ ><

--
-----------------------------------------------------------------
a word from the sponsor will appear below
-----------------------------------------------------------------
The TLUG mailing list is proudly sponsored by TWICS - Japan's First
Public-Access Internet System.  Now offering 20,000 yen/year flat
rate Internet access with no time charges.  Full line of corporate
Internet and intranet products are available.   info@example.com
Tel: 03-3351-5977   Fax: 03-3353-6096


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links