Mdadm issue
This is the first time I am setting up raid using the mdadm tool. This is what I am trying to do.
The sever is as follows: 2 drives at 10gig
2 drives at 80gig
hda2 is /
hdd1 is my /home
I have the other drives in ad ready and would like to set up the 2 10 gig's as a mirror and the 2 80 gig as raid0
At the shell I run this command
mdadm --create /dev/md0 --level=1 --raid-disks=2 /dev/hda2 /dev/hdb1 and get the following output:
mdadm: /dev/hda2 appears to contain an ext2fs file system
size=7269412K mtime=Mon Jul 1 11:56:16 2002
mdadm: /dev/hdb1 appears to contain an ext2fs file system
size=7333640K mtime=Mon Jul 1 11:56:29 2002Continue creating array? y
mdadm: SET_ARRAY_INFO failed for /dev/md0: File exists
Could someone please help me with this problem. I am having a really hard time finding any info on the web about this.
Quoted 17 lines · On Monday July 1, [email protected] wrote:
This is the first time I am setting up raid using the mdadm tool. This is what I am trying to do.
The sever is as follows: 2 drives at 10gig
2 drives at 80gig
hda2 is /
hdd1 is my /homeI have the other drives in ad ready and would like to set up the 2 10 gig's as a mirror and the 2 80 gig as raid0
At the shell I run this command
mdadm --create
/dev/md0--level=1 --raid-disks=2/dev/hda2/dev/hdb1and get the following output:mdadm:
/dev/hda2appears to contain an ext2fs file system
Quoted 8 lines
size=7269412K mtime=Mon Jul 1 11:56:16 2002 mdadm: /dev/hdb1 appears to contain an ext2fs file system size=7333640K mtime=Mon Jul 1 11:56:29 2002Continue creating array? y
mdadm:SET_ARRAY_INFOfailed for/dev/md0: File existsCould someone please help me with this problem. I am having a really hard time finding any info on the web about this.
hda2 is mounted as / and you are trying to make a raid1 array containing it. This cannot work.
What you want to do is:
mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/hdb1
to create a degraded array containing just hdb1.
Then:
mkfs /dev/md0
mount /dev/md0 /mnt
cp -ax / /mnt
to copy your root filesystem onto /dev/md0.
Then tell lilo:
append= "root=/dev/md0 md=0,/dev/hdb1"
and tell fstab that root in on /md0, and reboot.
Then you should be be running with root on /dev/md0 which consists of /dev/hdb1, and /dev/hda2 will be unused.
Then
mdadm --add /dev/md0 /dev/hda2
to add hda2 to the mirror. Wait for resync.
Change lilo.conf to say the right thinggs, run lilo and reboot.
Note: it appears that hdb1 is bigger than hda2. If this is so you will need to give a --size= to mdadm when created md0 so that it is small enough to be able to use hda2.
Subtract 128 K from the size of hda2, so
mdadm --create /dev/md0 --size=7269280 ......
NeilBrown
Thanks so much. That fixed it. It is now up and running.
Tom
:o)
Quoted 10 lines
-----Original Message-----
From: [email protected] [mailto:linux-raid- [email protected]] On Behalf Of Neil Brown
Sent: Wednesday, July 03, 2002 6:15 PM
To: Thomas Hicks
Cc: [email protected]
Subject: Re: Mdadm issueQuoted 1 line · On Monday July 1, [email protected] wrote:
This is the first time I am setting up raid using the mdadm tool.
This
Quoted 8 lines
Quoted 8 lines
is what I am trying to do.
The sever is as follows: 2 drives at 10gig
2 drives at 80gig
hda2 is /
hdd1 is my /homeI have the other drives in ad ready and would like to set up the 2
10
Quoted 5 lines
Quoted 5 lines
gig's as a mirror and the 2 80 gig as raid0
At the shell I run this command
mdadm --create
/dev/md0--level=1 --raid-disks=2/dev/hda2
/dev/hdb1
Quoted 42 lines
Quoted 11 lines
and get the following output:
mdadm:
/dev/hda2appears to contain an ext2fs file systemsize=7269412K mtime=Mon Jul 1 11:56:16 2002 mdadm: /dev/hdb1 appears to contain an ext2fs file system size=7333640K mtime=Mon Jul 1 11:56:29 2002Continue creating array? y
mdadm:SET_ARRAY_INFOfailed for/dev/md0: File existsCould someone please help me with this problem. I am having a really hard time finding any info on the web about this.
hda2 is mounted as / and you are trying to make a raid1 array containing it. This cannot work.
What you want to do is:mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/hdb1to create a degraded array containing just hdb1.
Then:
mkfs/dev/md0
mount/dev/md0/mnt
cp -ax / /mntto copy your root filesystem onto
/dev/md0.
Then tell lilo:append= "root=/dev/md0 md=0,/dev/hdb1"and tell fstab that root in on /md0, and reboot.
Then you should be be running with root on
/dev/md0which consists of/dev/hdb1, and/dev/hda2will be unused.
Then
mdadm --add/dev/md0/dev/hda2
to add hda2 to the mirror. Wait for resync.
Change lilo.conf to say the right thinggs, run lilo and reboot.Note: it appears that hdb1 is bigger than hda2. If this is so you will need to give a --size= to mdadm when created md0 so that it is small enough to be able to use hda2.
Subtract 128 K from the size of hda2, so
mdadm --create/dev/md0--size=7269280 ......
Quoted 4 lines
NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-raid"
in
Quoted 2 lines
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html