Re: kernel 2.2.x and swap to a raid device/file

2001-06-04 Thread Alvin Oga


hi giulio

what would be the point of making swap a raid0 or raid1 device ??
- if you have  problem... the machine will most likely
shutdown and you lose all swap data

just use a regular swap partition as swap... not /dev/mdxx

i'd try to use...
/   /dev/md0- so tht you can usually get into standalone mode
/tmp/dev/md1
/var/dev/md2
/usr/dev/md3
/home   /dev/md4
...

c ya
alvin
http://www.Linux-Sec.net


On Sun, 3 Jun 2001, Giulio Orsero wrote:

 kernel 2.2.19 raid 0.90 (2.4.x is not an option at this time for us).
 
 I'm interested in raid1 only.
 
 The hotwo says you cannot swap on a raid device when it's
 reconsrtucting/resyncing.
 
 I'd prefer not to play with scripts to avoid swapping until resync/reconstruct
 is done.
 
 Is swapping to a file inside a mirrored file-system safe, always, even when
 reconstruct/resync?
 
 ie
 1)
 /   -  /dev/md0  - /dev/hda1 /dev/hdc1
 swapon /root/swapfile
 is this always safe?
 
 2)
 /swap - /dev/md0 - /dev/hda1+/dev/hdc1
 / - /dev/md1 - /dev/hda2+/dev/hdc2
 
 mke2fs /dev/md0
 ... dd, mkswap...
 swapon /swap/swapfile
 is this always safe?
 
 
 This post from mingo seems to say so
 
http://groups.google.com/groups?hl=itlr=safe=offic=1th=693f77f441bf1844,2seekm=linux.kernel.39CF6A64.E56CB9A1%40roanoke.edu#p
 but it's not very clear, he talks about raid5.
 
 I'd like a definitive answer if possible :)
 
 Thanks
 
 -- 
 [EMAIL PROTECTED]
 -
 To unsubscribe from this list: send the line unsubscribe linux-raid in
 the body of a message to [EMAIL PROTECTED]
 

-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]



Re: kernel 2.2.x and swap to a raid device/file

2001-06-04 Thread Corin Hartland-Swann


Hi there,

On 3 Jun 2001, Gregory Leblanc wrote:
 On 03 Jun 2001 17:19:10 -0700, Alvin Oga wrote:
  just use a regular swap partition as swap... not /dev/mdxx
 
 You can do that, but it doesn't give you any redundancy.  See above.
 
 For what it's worth, I -believe- that SWAP to a file on any RAID
 filesystem is safe, but I don't actually know the code very well.  If
 you want to be safe with swap on RAID, upgrade to the 2.4.x kernels.  

I am fairly sure that swapping to a file on a RAID-1 mirror has the same
problem as swapping to a RAID-1 partition, i.e. it is NOT safe to swap
during reconstruction.

I have a different take on all this. If you're running a server which
lots of RAM is there any point in swapping? Memory is so cheap nowadays
that you can put the most obscene amount of RAM in anyway...

Doing without swap would be my recommendation if you can't move to 2.4

Regards,

Corin

/+-\
| Corin Hartland-Swann   |Tel: +44 (0) 20 7491 2000|
| Commerce Internet Ltd  |Fax: +44 (0) 20 7491 2010|
| 22 Cavendish Buildings | Mobile: +44 (0) 79 5854 0027| 
| Gilbert Street | |
| Mayfair|Web: http://www.commerce.uk.net/ |
| London W1K 5HJ | E-Mail: [EMAIL PROTECTED]|
\+-/

-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]



kernel 2.2.x and swap to a raid device/file

2001-06-04 Thread Giulio Orsero

kernel 2.2.19 raid 0.90 (2.4.x is not an option at this time for us).

I'm interested in raid1 only.

The hotwo says you cannot swap on a raid device when it's
reconsrtucting/resyncing.

I'd prefer not to play with scripts to avoid swapping until resync/reconstruct
is done.

Is swapping to a file inside a mirrored file-system safe, always, even when
reconstruct/resync?

ie
1)
/   -  /dev/md0  - /dev/hda1 /dev/hdc1
swapon /root/swapfile
is this always safe?

2)
/swap - /dev/md0 - /dev/hda1+/dev/hdc1
/ - /dev/md1 - /dev/hda2+/dev/hdc2

mke2fs /dev/md0
... dd, mkswap...
swapon /swap/swapfile
is this always safe?


This post from mingo seems to say so
http://groups.google.com/groups?hl=itlr=safe=offic=1th=693f77f441bf1844,2seekm=linux.kernel.39CF6A64.E56CB9A1%40roanoke.edu#p
but it's not very clear, he talks about raid5.

I'd like a definitive answer if possible :)

Thanks

-- 
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]



Re: kernel 2.2.x and swap to a raid device/file

2001-06-04 Thread Corin Hartland-Swann


Hi there,

On Mon, 4 Jun 2001, Luca Berra wrote:
 On Mon, Jun 04, 2001 at 05:13:11AM +0100, Corin Hartland-Swann wrote:
  I have a different take on all this. If you're running a server which
  lots of RAM is there any point in swapping? Memory is so cheap nowadays
  that you can put the most obscene amount of RAM in anyway...
 
 uhm, you always need swap, so the kernel can swap out unused pages and free
 memory for more useful things (e.g. buffer cache)
 
 i have 512Mb ram on my home system and i swap even without X

Agreed - the kernel will always swap out a small amount of stuff. This is
a sensible course of action, but in my experience it only adds up to a few
megs (5 or so).

My point is that the cost of 5M RAM is about $1.50, so you might as well
do without swap if it's going to cause you any problems (like the above).

What I really hate is the recommendations that you should always have
twice as much swap as main memory. I recently tried out FreeBSD on a box
with 4096M RAM. When I hit auto-allocate (or some such) it gave me 8192M
swap! As soon as main programs head into swap thrashing ensues and your
server goes to hell :(

Regards,

Corin

/+-\
| Corin Hartland-Swann   |Tel: +44 (0) 20 7491 2000|
| Commerce Internet Ltd  |Fax: +44 (0) 20 7491 2010|
| 22 Cavendish Buildings | Mobile: +44 (0) 79 5854 0027| 
| Gilbert Street | |
| Mayfair|Web: http://www.commerce.uk.net/ |
| London W1K 5HJ | E-Mail: [EMAIL PROTECTED]|
\+-/

-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]



Re: kernel 2.2.x and swap to a raid device/file

2001-06-04 Thread Luca Berra

On Mon, Jun 04, 2001 at 07:18:57PM +0100, Corin Hartland-Swann wrote:
 On Mon, 4 Jun 2001, Luca Berra wrote:
  On Mon, Jun 04, 2001 at 05:13:11AM +0100, Corin Hartland-Swann wrote:
 What I really hate is the recommendations that you should always have
 twice as much swap as main memory. I recently tried out FreeBSD on a box
 with 4096M RAM. When I hit auto-allocate (or some such) it gave me 8192M
 swap! As soon as main programs head into swap thrashing ensues and your
 server goes to hell :(
Some unices (i know of HP-UX) and W.NT insist on allocating enough space on
swap to fully swap out any process, so you cannot allocate 1Gb ram if you don't
have at least 1Gb swap (the other 1Gb is what would be really used as normal
swap) [linux is not the case]
Besides that other unices do use swap as a dump device, i know sgi is adding dump
support to linux, but i have never seen it working.
Lastly some application software do seem to allocate enormous quantities of memory
(sap reccomends about 3 time the system memory for swap, no this figure is not given
any amount of menory)

Regards,
L.
-- 
Luca Berra -- [EMAIL PROTECTED]
Communication Media  Services S.r.l.
 /\
 \ / ASCII RIBBON CAMPAIGN
  XAGAINST HTML MAIL
 / \
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]



Re: kernel 2.2.x and swap to a raid device/file

2001-06-04 Thread Al Hooton

Here's an approach to satisfy both camps: set up a ramdisk in that
cheap memory, and swap to that.  It's fast, and it keeps the kernel
happy.  Disclaimer: I haven't tried this yet, although it's on my list
of things to do sometime just to see how it works...

-Al


Corin Hartland-Swann wrote:
 
 Hi there,
 
 On Mon, 4 Jun 2001, Luca Berra wrote:
  On Mon, Jun 04, 2001 at 05:13:11AM +0100, Corin Hartland-Swann wrote:
   I have a different take on all this. If you're running a server which
   lots of RAM is there any point in swapping? Memory is so cheap nowadays
   that you can put the most obscene amount of RAM in anyway...
 
  uhm, you always need swap, so the kernel can swap out unused pages and free
  memory for more useful things (e.g. buffer cache)
 
  i have 512Mb ram on my home system and i swap even without X
 
 Agreed - the kernel will always swap out a small amount of stuff. This is
 a sensible course of action, but in my experience it only adds up to a few
 megs (5 or so).
 
 My point is that the cost of 5M RAM is about $1.50, so you might as well
 do without swap if it's going to cause you any problems (like the above).
 
 What I really hate is the recommendations that you should always have
 twice as much swap as main memory. I recently tried out FreeBSD on a box
 with 4096M RAM. When I hit auto-allocate (or some such) it gave me 8192M
 swap! As soon as main programs head into swap thrashing ensues and your
 server goes to hell :(
 
 Regards,
 
 Corin
 
 /+-\
 | Corin Hartland-Swann   |Tel: +44 (0) 20 7491 2000|
 | Commerce Internet Ltd  |Fax: +44 (0) 20 7491 2010|
 | 22 Cavendish Buildings | Mobile: +44 (0) 79 5854 0027|
 | Gilbert Street | |
 | Mayfair|Web: http://www.commerce.uk.net/ |
 | London W1K 5HJ | E-Mail: [EMAIL PROTECTED]|
 \+-/
 
 -
 To unsubscribe from this list: send the line unsubscribe linux-raid in
 the body of a message to [EMAIL PROTECTED]

-- 


---
| voice: 503.247.9256
  Lots of folks confuse bad management  | email: [EMAIL PROTECTED]
  with destiny. | cell: 503.709.0028
| email to my cell:
 - Kin Hubbard  | [EMAIL PROTECTED]
---
-
To unsubscribe from this list: send the line unsubscribe linux-raid in
the body of a message to [EMAIL PROTECTED]



PATCH: md.c - devfs naming fix.

2001-06-04 Thread Dave Cinege

Changes:
Cleaned a few printk's

Removed a meaningless ifndef.

Moved md= name_to_ kdev_t() processing from md_setup() to
md_setup_drive. Rewrote it and added devfs_find_handle() call
to support devfs names for md=. 

The devfs_find_handle() code is now redundant in my patch and
fs/super.c::mount_root(). It probably should be moved directly into
name_to_kdev_t(), no? If this was done the md= code would have worked as is,
except for the devfs code choking on the trailing ',' in the device_names
list. (Richard, want to check for this in the future?)

This diff is against md.c in 2.4.4.
Comments/testing please.

Thanks to Neil Brown for the recommendation...

--- md.c.orig   Sun Jun  3 13:58:35 2001
+++ md.cSun Jun  3 22:14:52 2001
@@ -3520,7 +3520,7 @@
max_readahead[MAJOR_NR] = md_maxreadahead;
hardsect_size[MAJOR_NR] = md_hardsect_sizes;
 
-   printk(md.c: sizeof(mdp_super_t) = %d\n, (int)sizeof(mdp_super_t));
+   dprintk(md: sizeof(mdp_super_t) = %d\n, (int)sizeof(mdp_super_t));
 
 #ifdef CONFIG_PROC_FS
create_proc_read_entry(mdstat, 0, NULL, md_status_read_proc, NULL);
@@ -3532,7 +3532,7 @@
static char * name = mdrecoveryd;
int minor;

-   printk (KERN_INFO md driver %d.%d.%d MAX_MD_DEVS=%d, MD_SB_DISKS=%d\n,
+   printk (KERN_INFO md: md driver %d.%d.%d MAX_MD_DEVS=%d, MD_SB_DISKS=%d\n,
MD_MAJOR_VERSION, MD_MINOR_VERSION,
MD_PATCHLEVEL_VERSION, MAX_MD_DEVS, MD_SB_DISKS);
 
@@ -3607,7 +3607,7 @@
mdk_rdev_t *rdev;
int i;
 
-   printk(KERN_INFO autodetecting RAID arrays\n);
+   printk(KERN_INFO md: Autodetecting RAID arrays.\n);
 
for (i = 0; i  dev_cnt; i++) {
kdev_t dev = detected_devices[i];
@@ -3641,6 +3641,7 @@
int pers[MAX_MD_DEVS];
int chunk[MAX_MD_DEVS];
kdev_t devices[MAX_MD_DEVS][MD_SB_DISKS];
+   char *device_names[MAX_MD_DEVS];
 } md_setup_args md__initdata;
 
 /*
@@ -3659,25 +3660,24 @@
  * md=n,device-list  reads a RAID superblock from the devices
  * elements in device-list are read by name_to_kdev_t so can be
  * a hex number or something like /dev/hda1 /dev/sdb
+ * 2001-06-03: Dave Cinege [EMAIL PROTECTED]
+ * Shifted name_to_kdev_t() and related operations to md_set_drive()
+ * for later execution. Rewrote section to make devfs compatible.
  */
-#ifndef MODULE
-extern kdev_t name_to_kdev_t(char *line) md__init;
 static int md__init md_setup(char *str)
 {
int minor, level, factor, fault, i=0;
-   kdev_t device;
-   char *devnames, *pername = ;
+   char *pername = ;
 
if (get_option(str, minor) != 2) {/* MD Number */
printk(md: Too few arguments supplied to md=.\n);
return 0;
}
if (minor = MAX_MD_DEVS) {
-   printk (md: Minor device number too high.\n);
+   printk (md: md=%d, Minor device number too high.\n, minor);
return 0;
-   } else if (md_setup_args.device_set[minor]) {
-   printk (md: Warning - md=%d,... has been specified twice;\n
-   will discard the first definition.\n, minor);
+   } else if (md_setup_args.device_names[minor]) {
+   printk (md: md=%d, Specified more then once. Replacing previous 
+definition.\n, minor);
}
switch (get_option(str, level)) { /* RAID Personality */
case 2: /* could be 0 or -1.. */
@@ -3714,30 +3714,13 @@
md_setup_args.pers[minor] = 0;
pername=super-block;
}
-   devnames = str;
-   for (; iMD_SB_DISKS  str; i++) {
-   if ((device = name_to_kdev_t(str))) {
-   md_setup_args.devices[minor][i] = device;
-   } else {
-   printk (md: Unknown device name, %s.\n, str);
-   return 0;
-   }
-   if ((str = strchr(str, ',')) != NULL)
-   str++;
-   }
-   if (!i) {
-   printk (md: No devices specified for md%d?\n, minor);
-   return 0;
-   }
-
-   printk (md: Will configure md%d (%s) from %s, below.\n,
-   minor, pername, devnames);
-   md_setup_args.devices[minor][i] = (kdev_t) 0;
-   md_setup_args.device_set[minor] = 1;
+   
+   md_setup_args.device_names[minor] = str;
+   
return 1;
 }
-#endif /* !MODULE */
 
+extern kdev_t name_to_kdev_t(char *line) md__init;
 void md__init md_setup_drive(void)
 {
int minor, i;
@@ -3745,16 +3728,50 @@
mddev_t*mddev;
 
for (minor = 0; minor  MAX_MD_DEVS; minor++) {
+   int err = 0;
+   char *devname;
mdu_disk_info_t dinfo;
 
-   int err = 0;
-   if