Re: using update-initramfs: how to get new mdadm.conf into the /boot? Or is it XFS?

2008-02-04 Thread maximilian attems
On Mon, Feb 04, 2008 at 02:59:44PM -0600, Moshe Yudkowsky wrote:
 Problem: on reboot, the I get an error message:
 
 root (hd0,1)  (Moshe comment: as expected)
 Filesystem type is xfs, partition type 0xfd (Moshe comment: as expected)
 kernel /boot/vmliuz-etc.-amd64 root=/dev/md/boot ro
 
 Error 15: File not found
 

error 15 is an *grub* error.

grub is known for it's dislike of xfs, so with this whole setup use ext3
rerun grub-install and you should be fine.
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Documentation? failure to update-initramfs causes Infinite md loop on boot

2008-01-30 Thread maximilian attems
On Wed, Jan 30, 2008 at 04:32:46PM -0600, Moshe Yudkowsky wrote:
 I reformatted the disks in preparation to my move to a RAID1/RAID5 
 combination. I couldn't --stop the array (that should have told me 
 something), so I removed ARRAY from mdadm.conf and restarted. I ran 
 fdisk to create the proper partitions, and then I removed the /dev/md* 
 and /dev/md/* entries in anticipation of creating the new ones. I then 
 rebooted to pick up the new partitions I'd created.

pretty simple, you change mdadm.conf put it also on initramfs:
update-initramfs -u -k all
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [mdadm] Monitor.c s/MAXINT/INT_MAX/g

2007-09-26 Thread maximilian attems
include limits.h directly instead of values.h

Signed-off-by: maximilian attems [EMAIL PROTECTED]
---
 Monitor.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Monitor.c b/Monitor.c
index 246bdc0..8bc3ecc 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -32,7 +32,7 @@
 #include   md_u.h
 #include   sys/wait.h
 #include   signal.h
-#include   values.h
+#include   limits.h
 #include   syslog.h
 
 static void alert(char *event, char *dev, char *disc, char *mailaddr, char 
*mailfrom,
@@ -172,7 +172,7 @@ int Monitor(mddev_dev_t devlist,
st-utime = 0;
st-next = statelist;
st-err = 0;
-   st-devnum = MAXINT;
+   st-devnum = INT_MAX;
st-percent = -2;
st-expected_spares = mdlist-spare_disks;
if (mdlist-spare_group)
@@ -192,7 +192,7 @@ int Monitor(mddev_dev_t devlist,
st-utime = 0;
st-next = statelist;
st-err = 0;
-   st-devnum = MAXINT;
+   st-devnum = INT_MAX;
st-percent = -2;
st-expected_spares = -1;
st-spare_group = NULL;
@@ -256,7 +256,7 @@ int Monitor(mddev_dev_t devlist,
close(fd);
continue;
}
-   if (st-devnum == MAXINT) {
+   if (st-devnum == INT_MAX) {
struct stat stb;
if (fstat(fd, stb) == 0 
(S_IFMTstb.st_mode)==S_IFBLK) {
@@ -269,7 +269,7 @@ int Monitor(mddev_dev_t devlist,
 
for (mse2 = mdstat ; mse2 ; mse2=mse2-next)
if (mse2-devnum == st-devnum) {
-   mse2-devnum = MAXINT; /* flag it as 
used */
+   mse2-devnum = INT_MAX; /* flag it as 
used */
mse = mse2;
}
 
@@ -402,7 +402,7 @@ int Monitor(mddev_dev_t devlist,
if (scan) {
struct mdstat_ent *mse;
for (mse=mdstat; mse; mse=mse-next) 
-   if (mse-devnum != MAXINT 
+   if (mse-devnum != INT_MAX 
(strcmp(mse-level, raid0)!=0 
 strcmp(mse-level, linear)!=0)
) {
-- 
1.5.3.1

-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [mdadm] mdopen.c don't shadow major() and minor()

2007-09-26 Thread maximilian attems
s/(major|minor)/\1_num/

Signed-off-by: maximilian attems [EMAIL PROTECTED]
---
 mdopen.c |   64 +++---
 1 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/mdopen.c b/mdopen.c
index 0b6951d..362d4d8 100644
--- a/mdopen.c
+++ b/mdopen.c
@@ -58,7 +58,7 @@ void make_parts(char *dev, int cnt, int symlinks)
 * else that of dev
 */
struct stat stb;
-   int major, minor;
+   int major_num, minor_num;
int i;
int nlen = strlen(dev) + 20;
char *name = malloc(nlen);
@@ -69,21 +69,21 @@ void make_parts(char *dev, int cnt, int symlinks)
return;
if (!S_ISBLK(stb.st_mode))
return;
-   major = major(stb.st_rdev);
-   minor = minor(stb.st_rdev);
+   major_num = major(stb.st_rdev);
+   minor_num = minor(stb.st_rdev);
for (i=1; i = cnt ; i++) {
struct stat stb2;
snprintf(name, nlen, %s%s%d, dev, dig?p:, i);
if (stat(name, stb2)==0) {
if (!S_ISBLK(stb2.st_mode))
continue;
-   if (stb2.st_rdev == makedev(major, minor+i))
+   if (stb2.st_rdev == makedev(major_num, minor_num+i))
continue;
unlink(name);
} else {
stb2 = stb;
}
-   if (mknod(name, S_IFBLK | 0600, makedev(major, minor+i)))
+   if (mknod(name, S_IFBLK | 0600, makedev(major_num, 
minor_num+i)))
perror(mknod);
if (chown(name, stb2.st_uid, stb2.st_gid))
perror(chown);
@@ -110,8 +110,8 @@ int open_mddev(char *dev, int autof)
 {
int mdfd;
struct stat stb;
-   int major = MD_MAJOR;
-   int minor = 0;
+   int major_num = MD_MAJOR;
+   int minor_num = 0;
int must_remove = 0;
struct mdstat_ent *mdlist;
int num;
@@ -138,7 +138,7 @@ int open_mddev(char *dev, int autof)
/* check major number is correct */
num = -1;
std = is_standard(dev, num);
-   if (std0) major = get_mdp_major();
+   if (std0) major_num = get_mdp_major();
switch(autof) {
case 2: /* only create is_standard names */
if (!std  !stb.st_mode) {
@@ -165,11 +165,11 @@ int open_mddev(char *dev, int autof)
case 5: /* default to md if not standard */
break;
case 6: /* default to mdp if not standard */
-   if (std == 0) major = get_mdp_major();
+   if (std == 0) major_num = get_mdp_major();
break;
}
/* major is final. num is -1 if not standard */
-   if (stb.st_mode  major(stb.st_rdev) != major)
+   if (stb.st_mode  major(stb.st_rdev) != major_num)
must_remove = 1;
if (stb.st_mode  !must_remove) {
/* looks ok, see if it is available */
@@ -184,7 +184,7 @@ int open_mddev(char *dev, int autof)
close(mdfd);
return -1;
}
-   if (major != MD_MAJOR  parts  0)
+   if (major_num != MD_MAJOR  parts  0)
make_parts(dev, parts, ci-symlinks);
return mdfd;
}
@@ -203,7 +203,7 @@ int open_mddev(char *dev, int autof)
for (num = 127 ; num != 128 ; num = num ? num-1 : 
(122)-1) {
struct mdstat_ent *me;
int devnum = num;
-   if (major != MD_MAJOR)
+   if (major_num != MD_MAJOR)
devnum = -1-num;
 
for (me=mdlist; me; me=me-next)
@@ -214,11 +214,11 @@ int open_mddev(char *dev, int autof)
 * make sure it is new to /dev too
 */
char *dn;
-   if (major != MD_MAJOR)
-   minor = num  MdpMinorShift;
+   if (major_num != MD_MAJOR)
+   minor_num = num  
MdpMinorShift;
else
-   minor = num;
-   dn = map_dev(major,minor, 0);
+   minor_num = num;
+   dn = map_dev(major_num,minor_num, 0);
if (dn

[PATCH] [mdadm] Monitor.c include signal.h directly

2007-09-26 Thread maximilian attems
another small step for better klibc support, glibc compile tested.

Signed-off-by: maximilian attems [EMAIL PROTECTED]
---
 Monitor.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Monitor.c b/Monitor.c
index 91f02a4..246bdc0 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -31,7 +31,7 @@
 #include   md_p.h
 #include   md_u.h
 #include   sys/wait.h
-#include   sys/signal.h
+#include   signal.h
 #include   values.h
 #include   syslog.h
 
-- 
1.5.3.1

-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [mdadm] config.c include dirent.h instead sys/dir.h

2007-09-21 Thread maximilian attems
sys/dir.h is an old BSD'ism, include dirent directly.
small step for better klibc support.

compile tested against glibc.

Signed-off-by: maximilian attems [EMAIL PROTECTED]
---
 config.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/config.c b/config.c
index 73031b7..68c1507 100644
--- a/config.c
+++ b/config.c
@@ -29,7 +29,7 @@
 
 #include   mdadm.h
 #include   dlink.h
-#include   sys/dir.h
+#include   dirent.h
 #include   glob.h
 #include   fnmatch.h
 #include   ctype.h
-- 
1.5.2.4

-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


md device naming question

2007-09-19 Thread maximilian attems
hello,

working on initramfs i'd be curious to know what the /sys/block
entry of a /dev/md/NN device is. have a user request to support
it and no handy box using it.

i presume it may also be /sys/block/mdNN ?


thanks

-- 
maks
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html