Best way to create RAID-6 for swap partition - existing one failed
Best way to create RAID-6 for swap partition - existing one failed
am 16.05.2011 23:41:23 von Gavin Flower
Hi,
Motivation, existing RAID-6 swap partition failed. I am thinking I sho=
uld recreate it in a new format, as currently it is 'Version : 0.90', r=
ather than simply rebuild it.
So 3 questions:
(1) What further diagnostics should I run first, if any (note I am curr=
ently running badblocks on the drive that dropped out), and I have put =
the existing diagnostic info at the end of this email
(2) What is the most appropriate RAID-6 format for a swap partition, ke=
eping same the number of drives and overall capacity.
(3) How to convert the existing /dev/md0 to the new format.
Cheers,
Gavin
# grep md0 /var/log/messages
May 16 04:05:47 saturn kernel: [ 3.658644] md: md0 stopped.
May 16 04:05:47 saturn kernel: [ 3.933910] md/raid:md0: not clean --=
starting background reconstruction
May 16 04:05:47 saturn kernel: [ 3.937796] md/raid:md0: device sda3 =
operational as raid disk 0
May 16 04:05:47 saturn kernel: [ 3.941540] md/raid:md0: device sdb3 =
operational as raid disk 4
May 16 04:05:47 saturn kernel: [ 3.945161] md/raid:md0: device sdd3 =
operational as raid disk 3
May 16 04:05:47 saturn kernel: [ 3.948706] md/raid:md0: device sdc3 =
operational as raid disk 2
May 16 04:05:47 saturn kernel: [ 3.953408] md/raid:md0: allocated 53=
34kB
May 16 04:05:47 saturn kernel: [ 3.956939] md/raid:md0: cannot start=
dirty degraded array.
May 16 04:05:47 saturn kernel: [ 3.961082] md/raid:md0: failed to ru=
n raid set.
May 16 04:05:47 saturn kernel: [ 3.968237] dracut: mdadm: failed to =
RUN_ARRAY /dev/md0: Input/output error
May 16 04:05:47 saturn kernel: [ 4.239948] dracut: mdadm: /dev/md0 i=
s already in use.
May 16 04:05:47 saturn kernel: [ 4.340048] dracut: mdadm: /dev/md0 i=
s already in use.
May 16 04:08:28 saturn kernel: [ 3.038486] md: md0 stopped.
May 16 04:08:28 saturn kernel: [ 3.205219] md/raid:md0: not clean --=
starting background reconstruction
May 16 04:08:28 saturn kernel: [ 3.206711] md/raid:md0: device sda3 =
operational as raid disk 0
May 16 04:08:28 saturn kernel: [ 3.208501] md/raid:md0: device sdb3 =
operational as raid disk 4
May 16 04:08:28 saturn kernel: [ 3.210254] md/raid:md0: device sdd3 =
operational as raid disk 3
May 16 04:08:28 saturn kernel: [ 3.211979] md/raid:md0: device sdc3 =
operational as raid disk 2
May 16 04:08:28 saturn kernel: [ 3.214179] md/raid:md0: allocated 53=
34kB
May 16 04:08:28 saturn kernel: [ 3.215917] md/raid:md0: cannot start=
dirty degraded array.
May 16 04:08:28 saturn kernel: [ 3.217880] md/raid:md0: failed to ru=
n raid set.
May 16 04:08:28 saturn kernel: [ 3.221377] dracut: mdadm: failed to =
RUN_ARRAY /dev/md0: Input/output error
May 16 04:08:28 saturn kernel: [ 3.425089] dracut: mdadm: /dev/md0 i=
s already in use.
May 16 04:08:28 saturn kernel: [ 4.118667] dracut: mdadm: /dev/md0 i=
s already in use.
May 17 00:58:12 saturn kernel: [ 3.006195] md: md0 stopped.
May 17 00:58:12 saturn kernel: [ 3.174154] md/raid:md0: not clean --=
starting background reconstruction
May 17 00:58:12 saturn kernel: [ 3.175688] md/raid:md0: device sda3 =
operational as raid disk 0
May 17 00:58:12 saturn kernel: [ 3.177218] md/raid:md0: device sdb3 =
operational as raid disk 4
May 17 00:58:12 saturn kernel: [ 3.178717] md/raid:md0: device sdd3 =
operational as raid disk 3
May 17 00:58:12 saturn kernel: [ 3.180196] md/raid:md0: device sdc3 =
operational as raid disk 2
May 17 00:58:12 saturn kernel: [ 3.182161] md/raid:md0: allocated 53=
34kB
May 17 00:58:12 saturn kernel: [ 3.183976] md/raid:md0: cannot start=
dirty degraded array.
May 17 00:58:12 saturn kernel: [ 3.186002] md/raid:md0: failed to ru=
n raid set.
May 17 00:58:12 saturn kernel: [ 3.189615] dracut: mdadm: failed to =
RUN_ARRAY /dev/md0: Input/output error
May 17 00:58:12 saturn kernel: [ 3.540474] dracut: mdadm: /dev/md0 i=
s already in use.
May 17 00:58:12 saturn kernel: [ 3.614348] dracut: mdadm: /dev/md0 i=
s already in use.
#=20
# grep md0 /var/log/messages-20110515
[â=A6]
May 12 03:05:12 saturn kernel: [132994.557873] md: delaying data-check =
of md0 until md1 has finished (they share one or more physical units)
May 12 03:24:41 saturn kernel: [134160.574564] md: data-check of RAID a=
rray md0
May 12 03:25:22 saturn kernel: [134202.299274] md: md0: data-check done=
May 13 00:15:00 saturn kernel: [ 3.046117] md: md0 stopped.
May 13 00:15:00 saturn kernel: [ 3.208950] md/raid:md0: device sda3 =
operational as raid disk 0
May 13 00:15:00 saturn kernel: [ 3.210743] md/raid:md0: device sdb3 =
operational as raid disk 4
May 13 00:15:00 saturn kernel: [ 3.212501] md/raid:md0: device sdd3 =
operational as raid disk 3
May 13 00:15:00 saturn kernel: [ 3.214246] md/raid:md0: device sdc3 =
operational as raid disk 2
May 13 00:15:00 saturn kernel: [ 3.215974] md/raid:md0: device sde3 =
operational as raid disk 1
May 13 00:15:00 saturn kernel: [ 3.218201] md/raid:md0: allocated 53=
34kB
May 13 00:15:00 saturn kernel: [ 3.219955] md/raid:md0: raid level 6=
active with 5 out of 5 devices, algorithm 2
May 13 00:15:00 saturn kernel: [ 3.221442] md0: detected capacity ch=
ange from 0 to 11009851392
May 13 00:15:00 saturn kernel: [ 3.223285] dracut: mdadm: /dev/md0 h=
as been started with 5 drives.
May 13 00:15:00 saturn kernel: [ 3.223971] md0: unknown partition t=
able
May 13 00:15:00 saturn kernel: [ 12.055465] Adding 10751804k swap on =
/dev/md0. Priority:-1 extents:1 across:10751804k=20
# date ; cat /proc/mdstat=20
Tue May 17 08:52:16 NZST 2011
Personalities : [raid6] [raid5] [raid4]=20
md2 : active raid6 sda4[0] sdc4[6] sdd4[3] sdb4[5] sde4[1]
1114745856 blocks super 1.1 level 6, 512k chunk, algorithm 2 [5/5=
] [UUUUU]
bitmap: 2/3 pages [8KB], 65536KB chunk
md1 : active raid6 sda2[0] sdc2[4] sdd2[3] sde2[2] sdb2[1]
307198464 blocks level 6, 512k chunk, algorithm 2 [5/5] [UUUUU]
=20
md0 : inactive sda3[0] sdb3[4] sdd3[3] sdc3[2]
14335744 blocks
=20
unused devices:
# mdadm --detail /dev/md0
/dev/md0:
Version : 0.90
Creation Time : Thu Dec 3 13:05:42 2009
Raid Level : raid6
Used Dev Size : 3583936 (3.42 GiB 3.67 GB)
Raid Devices : 5
Total Devices : 4
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Mon May 16 03:56:48 2011
State : active, degraded, Not Started
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 64K
UUID : 3b76ac20:8253f696:bfe78010:bc810f04
Events : 0.11171
Number Major Minor RaidDevice State
0 8 3 0 active sync /dev/sda3
1 0 0 1 removed
2 8 35 2 active sync /dev/sdc3
3 8 51 3 active sync /dev/sdd3
4 8 19 4 active sync /dev/sdb3
# mdadm --stop /dev/md0
mdadm: stopped /dev/md0
# date ; cat /proc/mdstat
Tue May 17 09:04:49 NZST 2011
Personalities : [raid6] [raid5] [raid4]=20
md2 : active raid6 sda4[0] sdc4[6] sdd4[3] sdb4[5] sde4[1]
1114745856 blocks super 1.1 level 6, 512k chunk, algorithm 2 [5/5=
] [UUUUU]
bitmap: 2/3 pages [8KB], 65536KB chunk
md1 : active raid6 sda2[0] sdc2[4] sdd2[3] sde2[2] sdb2[1]
307198464 blocks level 6, 512k chunk, algorithm 2 [5/5] [UUUUU]
=20
unused devices:
#=20
--
All Adults share the Responsibility
to help Raise Today's Children,
for they are Tomorrow's Society!
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 18.05.2011 17:01:53 von David Brown
On 16/05/2011 23:41, Gavin Flower wrote:
> Hi,
>
> Motivation, existing RAID-6 swap partition failed. I am thinking I
> should recreate it in a new format, as currently it is 'Version :
> 0.90', rather than simply rebuild it.
>
> So 3 questions:
>
> (1) What further diagnostics should I run first, if any (note I am
> currently running badblocks on the drive that dropped out), and I
> have put the existing diagnostic info at the end of this email
>
>
> (2) What is the most appropriate RAID-6 format for a swap partition,
> keeping same the number of drives and overall capacity.
>
> (3) How to convert the existing /dev/md0 to the new format.
>
>
RAID-6 is a lot of overhead for a 5-drive array. Unless you have plans
to add more drives or resize it, you are going to get a lot faster
performance with a raid-10,far layout at little extra space cost.
RAID-6 is particularly slow for small writes, as the whole stripe needs
to be read in for an update - I think that would hit swap usage pretty hard.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 18.05.2011 20:59:31 von Stan Hoeppner
On 5/16/2011 4:41 PM, Gavin Flower wrote:
> Motivation, existing RAID-6 swap partition failed. I am thinking I should recreate it in a new format, as currently it is 'Version : 0.90', rather than simply rebuild it.
Forget using a partition. Simply use a swap file. This example creates
a 1GB swap file in the / filesystem. You can locate it on any
filesystem you wish.
# swappoff -a
# dd if=/dev/zero of=/swapfile1 bs=1024 count=1048576
# mkswap /swapfile1
# swapon /swapfile1
# vi /etc/fstab
Add:
/swapfile1 swap swap defaults 0 0
and remove your old entry for the failed swap partition.
There is little performance difference between swap files and swap
partitions with modern kernels. The kernel will map the disk location
of the swap file and perform direct disk access, bypassing the
filesystem and buffer cache.
--
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing onefailed
am 18.05.2011 21:57:22 von likewhoa
Why not just let the kernel handle the stripping for you, IMO using
dmraid is overkill for swap when it can all be handled by the kernel
itself with 'swap -p1 /dev/sda1' for example.
On Wed, 2011-05-18 at 13:59 -0500, Stan Hoeppner wrote:
> On 5/16/2011 4:41 PM, Gavin Flower wrote:
>
> > Motivation, existing RAID-6 swap partition failed. I am thinking I should recreate it in a new format, as currently it is 'Version : 0.90', rather than simply rebuild it.
>
>
> Forget using a partition. Simply use a swap file. This example creates
> a 1GB swap file in the / filesystem. You can locate it on any
> filesystem you wish.
>
> # swappoff -a
> # dd if=/dev/zero of=/swapfile1 bs=1024 count=1048576
> # mkswap /swapfile1
> # swapon /swapfile1
> # vi /etc/fstab
> Add:
> /swapfile1 swap swap defaults 0 0
>
> and remove your old entry for the failed swap partition.
>
> There is little performance difference between swap files and swap
> partitions with modern kernels. The kernel will map the disk location
> of the swap file and perform direct disk access, bypassing the
> filesystem and buffer cache.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 18.05.2011 22:13:15 von Gavin Flower
--- On Thu, 19/5/11, Stan Hoeppner wrote:
> From: Stan Hoeppner
> Subject: Re: Best way to create RAID-6 for swap partition - existing =
one failed
> To: "Gavin Flower"
> Cc: linux-raid@vger.kernel.org, neilb@suse.de, mb@gem.win.co.nz
> Date: Thursday, 19 May, 2011, 6:59
> On 5/16/2011 4:41 PM, Gavin Flower
> wrote:
>=20
> > Motivation, existing RAID-6 swap partition
> failed.=A0 I am thinking I should recreate it in a new
> format, as currently it is 'Version : 0.90', rather than
> simply rebuild it.
>
>=20
> Forget using a partition.=A0 Simply use a swap
> file.=A0 This example creates
> a 1GB swap file in the / filesystem.=A0 You can locate
> it on any
> filesystem you wish.
>=20
> # swappoff -a
> # dd if=3D/dev/zero of=3D/swapfile1 bs=3D1024 count=3D1048576
> # mkswap /swapfile1
> # swapon /swapfile1
> # vi /etc/fstab
> Add:
> /swapfile1 swap swap defaults 0 0
>=20
> and remove your old entry for the failed swap partition.
>=20
> There is little performance difference between swap files
> and swap
> partitions with modern kernels.=A0 The kernel will map
> the disk location
> of the swap file and perform direct disk access, bypassing
> the
> filesystem and buffer cache.
>=20
> --=20
> Stan
>=20
Thanks.
Interesting!
(Reminds me of when I first got into Linux. Then you could have any si=
ze swap file up to 128 MB, and have up to 8 swap files, for a maximum o=
f 1 GB. I then had about 64 MB of RAM - now I have 8 GB of RAM. Also, s=
wap partitions were recommended. When the 2.4 kernel first came out, i=
t was said to be faster if you had at least 16 MB.)
I read up and could not see any benefit in changing, so I ended up 'sim=
ply' reassembling the partition.
The 2 things I had thought of altering, were the version of the super b=
lock and the chunk size. With the amount of RAM I have, performance is =
not normally an issue, I was thinking of reliability. The badblocks ru=
n did not reveal any problems, nor did checking the smart diagnostics i=
n detail reveal anything significant. I think it was some kind of kern=
el error, transient anyhow.
SUGGESTION:
Could we please have some explanation of the benefits and tradeoffs bet=
ween the different values of things like chunk size and super block ver=
sion.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 18.05.2011 22:32:13 von Gavin Flower
--- On Thu, 19/5/11, likewhoa wrote:
> From: likewhoa
> Subject: Re: Best way to create RAID-6 for swap partition - existing one failed
> To: "Gavin Flower"
> Cc: linux-raid@vger.kernel.org
> Date: Thursday, 19 May, 2011, 7:57
> Why not just let the kernel handle
> the stripping for you, IMO using
> dmraid is overkill for swap when it can all be handled by
> the kernel
> itself with 'swap -p1 /dev/sda1' for example.
[...]
Could you please tell where to read up on that, URL or man page. I do not know where to apply your suggestion, nor the meaning of the '-p1' option.
I should have said the original problem was associated with hibernation. (I also have 2 other desk tops that don't use RAID for swap.)
For now, I'll leave the swap as is - but, I will rethink how I implement swap when I upgrade to Fedora 15.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 18.05.2011 22:42:04 von Gavin Flower
--- On Thu, 19/5/11, Stan Hoeppner wrote:
> From: Stan Hoeppner
> Subject: Re: Best way to create RAID-6 for swap partition - existing =
one failed
> To: "Gavin Flower"
> Cc: linux-raid@vger.kernel.org, neilb@suse.de, mb@gem.win.co.nz
> Date: Thursday, 19 May, 2011, 6:59
[...]
> Forget using a partition.=A0 Simply use a swap
> file.=A0 This example creates
> a 1GB swap file in the / filesystem.=A0 You can locate
> it on any
> filesystem you wish.
>=20
> # swappoff -a
> # dd if=3D/dev/zero of=3D/swapfile1 bs=3D1024 count=3D1048576
> # mkswap /swapfile1
> # swapon /swapfile1
> # vi /etc/fstab
> Add:
> /swapfile1 swap swap defaults 0 0
>=20
> and remove your old entry for the failed swap partition.
>=20
> There is little performance difference between swap files
> and swap
> partitions with modern kernels.=A0 The kernel will map
> the disk location
> of the swap file and perform direct disk access, bypassing
> the
> filesystem and buffer cache.
>=20
> --=20
> Stan
>=20
I just checked the man page for mkswap, it still recommends using a par=
tition.
"WARNING
The swap header does not touch the first block. A boot loader o=
r disk label can be there, but it is not a recommended setup. The rec=
ommended setup is to use a separate partition for a Linux swap area."
I am curious to know the tradeoffs between having a file and using a pa=
rtition for swap. While it may not make much difference in my current =
situation, it might to others.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing onefailed
am 18.05.2011 22:59:56 von likewhoa
--=-OoKjezK1tQgUZAmWaLll
Content-Type: text/plain; charset="ANSI_X3.4-1968"
Content-Transfer-Encoding: quoted-printable
read 'man 2 swapon' for info on the -p flag.
On Wed, 2011-05-18 at 13:32 -0700, Gavin Flower wrote:
> --- On Thu, 19/5/11, likewhoa wrote:
>=20
> > From: likewhoa
> > Subject: Re: Best way to create RAID-6 for swap partition - existing on=
e failed
> > To: "Gavin Flower"
> > Cc: linux-raid@vger.kernel.org
> > Date: Thursday, 19 May, 2011, 7:57
> > Why not just let the kernel handle
> > the stripping for you, IMO using
> > dmraid is overkill for swap when it can all be handled by
> > the kernel
> > itself with 'swap -p1 /dev/sda1' for example.
> [...]
>=20
> Could you please tell where to read up on that, URL or man page. I do no=
t know where to apply your suggestion, nor the meaning of the '-p1' option.
>=20
> I should have said the original problem was associated with hibernation. =
(I also have 2 other desk tops that don't use RAID for swap.)
>=20
> For now, I'll leave the swap as is - but, I will rethink how I implement =
swap when I upgrade to Fedora 15.
>=20
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--=-OoKjezK1tQgUZAmWaLll
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
iQEcBAABAgAGBQJN1DNMAAoJEANL4SLpFTLyYp0IALA7ALziDc/PFxEBYlXv Puqk
ejEhBfLkLMFEUMFoF0nwErNkXMtnU/brHP9pxtA6uAde69X0PgwvQG51vryo 67SR
u4nUYCvtLxe6uR/wOLjFyBLX0cTZ9dmBiaIjv0ZN6H8KUJxlHve68C8Xaevp IuE3
N1vC5JwWregAXFfAIM5lOSfd5HPCEtJcOdArjvFqKPNuKpHWuOmhVlFmb6nC 0tz5
qluu+H0v1MgTEdY/r+d4ZXMTlxsXj8d1f542tIz1OZJQRjTf1owSeWtpbXZx pFlT
AmVWvyPgU9aC2bGQ0EI8XWu5wNqYxZJd/oTNcS3MH7tN1GMSmR7PifANmCuV Th0=
=/9la
-----END PGP SIGNATURE-----
--=-OoKjezK1tQgUZAmWaLll--
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 18.05.2011 23:53:39 von Stan Hoeppner
On 5/18/2011 3:13 PM, Gavin Flower wrote:
> --- On Thu, 19/5/11, Stan Hoeppner wrote:
>
>> From: Stan Hoeppner
>> Subject: Re: Best way to create RAID-6 for swap partition - existing one failed
>> To: "Gavin Flower"
>> Cc: linux-raid@vger.kernel.org, neilb@suse.de, mb@gem.win.co.nz
>> Date: Thursday, 19 May, 2011, 6:59
>> On 5/16/2011 4:41 PM, Gavin Flower
>> wrote:
>>
>>> Motivation, existing RAID-6 swap partition
>> failed. I am thinking I should recreate it in a new
>> format, as currently it is 'Version : 0.90', rather than
>> simply rebuild it.
>>
>>
>> Forget using a partition. Simply use a swap
>> file. This example creates
>> a 1GB swap file in the / filesystem. You can locate
>> it on any
>> filesystem you wish.
>>
>> # swappoff -a
>> # dd if=/dev/zero of=/swapfile1 bs=1024 count=1048576
>> # mkswap /swapfile1
>> # swapon /swapfile1
>> # vi /etc/fstab
>> Add:
>> /swapfile1 swap swap defaults 0 0
>>
>> and remove your old entry for the failed swap partition.
>>
>> There is little performance difference between swap files
>> and swap
>> partitions with modern kernels. The kernel will map
>> the disk location
>> of the swap file and perform direct disk access, bypassing
>> the
>> filesystem and buffer cache.
>>
>> --
>> Stan
>>
>
> Thanks.
>
> Interesting!
>
> (Reminds me of when I first got into Linux. Then you could have any size swap file up to 128 MB, and have up to 8 swap files, for a maximum of 1 GB. I then had about 64 MB of RAM - now I have 8 GB of RAM. Also, swap partitions were recommended. When the 2.4 kernel first came out, it was said to be faster if you had at least 16 MB.)
>
> I read up and could not see any benefit in changing, so I ended up 'simply' reassembling the partition.
The big benefits are flexibility, simplicity, and time consumed. Given
your particular case it seems a bit ironic that you see no benefit in
using swap files. The time to resolution in this case would be mere
seconds with swap files. How much total time did you spend reassembling
your swap partition, bot command execution time, but your total time?
--
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 19.05.2011 00:26:03 von Stan Hoeppner
On 5/18/2011 3:42 PM, Gavin Flower wrote:
> I just checked the man page for mkswap, it still recommends using a partition.
Gavin, you know who Andrew Morton is, yes? His opinion on the subject:
http://lkml.org/lkml/2005/7/7/326
Don't know about you, but I think I'll trust Morton's opinion on this
more than the writer of the mkswap man page. BTW, the similarities
between what I wrote earlier and Morton's comments in the lkml thread
above are not coincidental. ;)
--
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 19.05.2011 00:31:55 von Gavin Flower
--- On Thu, 19/5/11, Stan Hoeppner wrote:
> From: Stan Hoeppner
> Subject: Re: Best way to create RAID-6 for swap partition - existing =
one failed
> To: "Gavin Flower"
> Cc: linux-raid@vger.kernel.org, neilb@suse.de, mb@gem.win.co.nz
> Date: Thursday, 19 May, 2011, 9:53
> On 5/18/2011 3:13 PM, Gavin Flower
> wrote:
> > --- On Thu, 19/5/11, Stan Hoeppner
> wrote:
> >=20
> >> From: Stan Hoeppner
> >> Subject: Re: Best way to create RAID-6 for swap
> partition - existing one failed
> >> To: "Gavin Flower"
> >> Cc: linux-raid@vger.kernel.org,
> neilb@suse.de, mb@gem.win.co.nz
> >> Date: Thursday, 19 May, 2011, 6:59
> >> On 5/16/2011 4:41 PM, Gavin Flower
> >> wrote:
> >>
> >>> Motivation, existing RAID-6 swap partition
> >> failed.=A0 I am thinking I should recreate it
> in a new
> >> format, as currently it is 'Version : 0.90',
> rather than
> >> simply rebuild it.
> >>
> >>
> >> Forget using a partition.=A0 Simply use a swap
> >> file.=A0 This example creates
> >> a 1GB swap file in the / filesystem.=A0 You can
> locate
> >> it on any
> >> filesystem you wish.
> >>
> >> # swappoff -a
> >> # dd if=3D/dev/zero of=3D/swapfile1 bs=3D1024
> count=3D1048576
> >> # mkswap /swapfile1
> >> # swapon /swapfile1
> >> # vi /etc/fstab
> >> Add:
> >> /swapfile1 swap swap defaults 0 0
> >>
> >> and remove your old entry for the failed swap
> partition.
> >>
> >> There is little performance difference between
> swap files
> >> and swap
> >> partitions with modern kernels.=A0 The kernel
> will map
> >> the disk location
> >> of the swap file and perform direct disk access,
> bypassing
> >> the
> >> filesystem and buffer cache.
> >>
> >> --=20
> >> Stan
> >>
> >=20
> > Thanks.
> >=20
> > Interesting!
> >=20
> > (Reminds me of when I first got into Linux.=A0 Then
> you could have any size swap file up to 128 MB, and have up
> to 8 swap files, for a maximum of 1 GB. I then had about 64
> MB of RAM - now I have 8 GB of RAM. Also, swap partitions
> were recommended.=A0 When the 2.4 kernel first came out,
> it was said to be faster if you had at least 16 MB.)
> >=20
> > I read up and could not see any benefit in changing,
> so I ended up 'simply' reassembling the partition.
>=20
> The big benefits are flexibility, simplicity, and time
> consumed.=A0 Given
> your particular case it seems a bit ironic that you see no
> benefit in
> using swap files.=A0 The time to resolution in this case
> would be mere
> seconds with swap files.=A0 How much total time did you
> spend reassembling
> your swap partition, bot command execution time, but your
> total time?
>=20
> --=20
> Stan
>=20
I took longer than I'm prepared to admit! :-)
I'll take note, and either apply your idea next time it happens, or whe=
n I do a major O/S upgrade.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 19.05.2011 00:55:18 von Gavin Flower
--- On Thu, 19/5/11, Stan Hoeppner wrote:
> From: Stan Hoeppner
> Subject: Re: Best way to create RAID-6 for swap partition - existing =
one failed
> To: "Gavin Flower"
> Cc: linux-raid@vger.kernel.org, neilb@suse.de, mb@gem.win.co.nz
> Date: Thursday, 19 May, 2011, 10:26
> On 5/18/2011 3:42 PM, Gavin Flower
> wrote:
>=20
> > I just checked the man page for mkswap, it still
> recommends using a partition.
>=20
> Gavin, you know who Andrew Morton is, yes?=A0 His
> opinion on the subject:
>=20
> http://lkml.org/lkml/2005/7/7/326
>=20
> Don't know about you, but I think I'll trust Morton's
> opinion on this
> more than the writer of the mkswap man page.=A0 BTW, the
> similarities
> between what I wrote earlier and Morton's comments in the
> lkml thread
> above are not coincidental. ;)
>=20
> --=20
> Stan
>=20
Andrew Morton is God's 2nd in command. :-)
He took over from Alan Cox.
Seeing how all too frequently I have problems recovering from hibernati=
on due to the video driver crashing, and my system can at least start w=
ithout swap (I have 8GB) - I think will implement the file idea next ti=
me I do a major O/S upgrade.
Currently my options seems to be to either continue with my RAID-6 swap=
partition (which I have done) or to use a file within another RAID-6 p=
artition.
I now have a policy of trying to spend more time understanding why I sh=
ould do things a particular way, rather than simply following recipes b=
lindly. partly because I am a geek, and partly it might be useful profe=
ssionally.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 19.05.2011 01:01:21 von Stan Hoeppner
On 5/18/2011 5:31 PM, Gavin Flower wrote:
> I took longer than I'm prepared to admit! :-)
>
> I'll take note, and either apply your idea next time it happens, or when I do a major O/S upgrade.
You seem to see this as a major system change, something not dare
implemented 'on the fly'. It takes 60 seconds and you're done, with
zero downside, zero worries.
There are high security environments that deactivate and clear swap
files with dd at each logoff, as well as dropping all caches, then
reactivate the swap file. Swap files are not fragile.
--
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 19.05.2011 02:11:47 von Gavin Flower
--- On Thu, 19/5/11, Stan Hoeppner wrote:
> From: Stan Hoeppner
> Subject: Re: Best way to create RAID-6 for swap partition - existing =
one failed
> To: "Gavin Flower"
> Cc: linux-raid@vger.kernel.org, neilb@suse.de, mb@gem.win.co.nz
> Date: Thursday, 19 May, 2011, 6:59
> On 5/16/2011 4:41 PM, Gavin Flower
> wrote:
>=20
> > Motivation, existing RAID-6 swap partition
> failed.=A0 I am thinking I should recreate it in a new
> format, as currently it is 'Version : 0.90', rather than
> simply rebuild it.
>
>=20
> Forget using a partition.=A0 Simply use a swap
> file.=A0 This example creates
> a 1GB swap file in the / filesystem.=A0 You can locate
> it on any
> filesystem you wish.
>=20
> # swappoff -a
> # dd if=3D/dev/zero of=3D/swapfile1 bs=3D1024 count=3D1048576
> # mkswap /swapfile1
> # swapon /swapfile1
> # vi /etc/fstab
> Add:
> /swapfile1 swap swap defaults 0 0
>=20
> and remove your old entry for the failed swap partition.
>=20
> There is little performance difference between swap files
> and swap
> partitions with modern kernels.=A0 The kernel will map
> the disk location
> of the swap file and perform direct disk access, bypassing
> the
> filesystem and buffer cache.
>=20
> --=20
> Stan
>=20
Okay Stan,
What obvious thing have I done, or not done, here?
What should I do now?
(I am not panicking, because I can always revert back...)
I tried to implement you suggestion,=20
# swapoff -a
# dd if=3D/dev/zero of=3D/swapfile1 bs=3D1K count=3D16M
16777216+0 records in
16777216+0 records out
17179869184 bytes (17 GB) copied, 119.642 s, 144 MB/s
# mkswap /swapfile1
Setting up swapspace version 1, size =3D 16777212 KiB
no label, UUID=3D9afbf206-9a79-45b8-ad4b-148f71c440d7
# swapon /swapfile1
# cp /etc/fstab /etc/fstab-20110519
in
/etc/fstab
I replaced
UUID=3D654f3b90-ed2c-4de6-9f2a-e2ad65fd1af1 swap swa=
p defaults 0 0
by
/swapfile1 swap swap =
defaults 0 0
The log message for the swapon was:
May 19 11:27:38 saturn kernel: [38075.451398] Adding 16777212k swap on =
/swapfile1. Priority:-1 extents:159 across:24068092k=20
However, it failed to hibernate. The log messages were:
May 19 11:44:43 saturn kernel: [39043.115385] sd 1:0:0:0: [sdb] Startin=
g disk
May 19 11:44:43 saturn kernel: [39043.128453] sd 2:0:0:0: [sdc] Startin=
g disk
May 19 11:44:43 saturn kernel: [39043.140116] sd 3:0:0:0: [sdd] Startin=
g disk
May 19 11:44:43 saturn kernel: [39043.150889] sd 5:0:0:0: [sde] Startin=
g disk
May 19 11:44:43 saturn kernel: [39043.165729] PM: thaw of devices compl=
ete after 756.642 msecs
May 19 11:44:43 saturn kernel: [39043.322491] PM: Saving image data pag=
es (809839 pages) ... done
May 19 11:44:43 saturn kernel: [39094.461575] PM: Wrote 3239356 kbytes =
in 51.13 seconds (63.35 MB/s)
May 19 11:44:43 saturn kernel: [39094.465739] PM: S
May 19 11:44:43 saturn kernel: [39094.482407] PM: Swap header not found=
!
May 19 11:44:43 saturn kernel: [39094.485188] |
May 19 11:44:43 saturn kernel: [39094.706731] Restarting tasks ... done=
May 19 11:44:43 saturn NetworkManager[1501]: wake requested (sle=
eping: yes enabled: yes)
May 19 11:44:43 saturn NetworkManager[1501]: waking up and re-en=
abling...
May 19 11:44:43 saturn NetworkManager[1501]: (eth0): now managed
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 19.05.2011 04:26:27 von Stan Hoeppner
On 5/18/2011 7:11 PM, Gavin Flower wrote:
We're getting pretty OT here...
> What obvious thing have I done, or not done, here?
>
> What should I do now?
>
> (I am not panicking, because I can always revert back...)
>
> I tried to implement you suggestion,
>
> # swapoff -a
> # dd if=/dev/zero of=/swapfile1 bs=1K count=16M
> 16777216+0 records in
> 16777216+0 records out
> 17179869184 bytes (17 GB) copied, 119.642 s, 144 MB/s
> # mkswap /swapfile1
> Setting up swapspace version 1, size = 16777212 KiB
> no label, UUID=9afbf206-9a79-45b8-ad4b-148f71c440d7
17GB is a bit ridiculous for swap, especially on a single user machine.
> # swapon /swapfile1
> # cp /etc/fstab /etc/fstab-20110519
>
> in
> /etc/fstab
> I replaced
> UUID=654f3b90-ed2c-4de6-9f2a-e2ad65fd1af1 swap swap defaults 0 0
> by
> /swapfile1 swap swap defaults 0 0
>
> The log message for the swapon was:
> May 19 11:27:38 saturn kernel: [38075.451398] Adding 16777212k swap on /swapfile1. Priority:-1 extents:159 across:24068092k
Looks good.
> However, it failed to hibernate. The log messages were:
> May 19 11:44:43 saturn kernel: [39043.115385] sd 1:0:0:0: [sdb] Starting disk
> May 19 11:44:43 saturn kernel: [39043.128453] sd 2:0:0:0: [sdc] Starting disk
> May 19 11:44:43 saturn kernel: [39043.140116] sd 3:0:0:0: [sdd] Starting disk
> May 19 11:44:43 saturn kernel: [39043.150889] sd 5:0:0:0: [sde] Starting disk
> May 19 11:44:43 saturn kernel: [39043.165729] PM: thaw of devices complete after 756.642 msecs
> May 19 11:44:43 saturn kernel: [39043.322491] PM: Saving image data pages (809839 pages) ... done
> May 19 11:44:43 saturn kernel: [39094.461575] PM: Wrote 3239356 kbytes in 51.13 seconds (63.35 MB/s)
> May 19 11:44:43 saturn kernel: [39094.465739] PM: S
> May 19 11:44:43 saturn kernel: [39094.482407] PM: Swap header not found!
> May 19 11:44:43 saturn kernel: [39094.485188] |
> May 19 11:44:43 saturn kernel: [39094.706731] Restarting tasks ... done.
> May 19 11:44:43 saturn NetworkManager[1501]: wake requested (sleeping: yes enabled: yes)
> May 19 11:44:43 saturn NetworkManager[1501]: waking up and re-enabling...
> May 19 11:44:43 saturn NetworkManager[1501]: (eth0): now managed
I've never used hibernation, but a quick Google search gives lots of
information on this. Google "linux swap file hibernate". I read one
thread from 2008, in which folks easily solved this with a kernel update
or switching the filesystem where they stored the swap file. I would
think 3 years later any bugs in the hibernation code have been squashed
and this should work flawlessly.
What kernel/distro version are you running? Anything recent should be
able to handle hibernation to a swap file.
--
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 19.05.2011 04:50:27 von Gavin Flower
--- On Thu, 19/5/11, Stan Hoeppner wrote:
> From: Stan Hoeppner
> Subject: Re: Best way to create RAID-6 for swap partition - existing =
one failed
> To: "Gavin Flower"
> Cc: linux-raid@vger.kernel.org, neilb@suse.de, mb@gem.win.co.nz
> Date: Thursday, 19 May, 2011, 14:26
> On 5/18/2011 7:11 PM, Gavin Flower
> wrote:
>=20
> We're getting pretty OT here...
>=20
> > What obvious thing have I done, or not done, here?
> >=20
> > What should I do now?
> >=20
> > (I am not panicking, because I can always revert
> back...)
> >=20
> > I tried to implement you suggestion,=20
> >=20
> > # swapoff -a
> > # dd if=3D/dev/zero of=3D/swapfile1 bs=3D1K count=3D16M
> > 16777216+0 records in
> > 16777216+0 records out
> > 17179869184 bytes (17 GB) copied, 119.642 s, 144 MB/s
> > # mkswap /swapfile1
> > Setting up swapspace version 1, size =3D 16777212 KiB
> > no label, UUID=3D9afbf206-9a79-45b8-ad4b-148f71c440d7
>=20
> 17GB is a bit ridiculous for swap, especially on a single
> user machine.
Strictly speaking, I should have used the recommended 10GB (2GB + RAM s=
ize) to allow for hibernation.
> > # swapon /swapfile1
> > # cp /etc/fstab /etc/fstab-20110519
> >=20
> > in
> > /etc/fstab
> > I replaced
> > UUID=3D654f3b90-ed2c-4de6-9f2a-e2ad65fd1af1 swap=A0
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> =A0 swap=A0 =A0 defaults=A0 =A0 =A0 =A0
> 0 0
> > by
> > /swapfile1=A0 =A0 =A0 =A0 =A0 =A0
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
> =A0 =A0 swap=A0 =A0 =A0 =A0 =A0 =A0
> =A0 =A0 =A0 =A0 swap=A0 =A0 defaults=A0
> =A0 =A0 =A0 0 0
> >=20
> > The log message for the swapon was:
> > May 19 11:27:38 saturn kernel: [38075.451398] Adding
> 16777212k swap on /swapfile1.=A0 Priority:-1 extents:159
> across:24068092k=20
>=20
> Looks good.
>=20
> > However, it failed to hibernate.=A0 The log
> messages were:
> > May 19 11:44:43 saturn kernel: [39043.115385] sd
> 1:0:0:0: [sdb] Starting disk
> > May 19 11:44:43 saturn kernel: [39043.128453] sd
> 2:0:0:0: [sdc] Starting disk
> > May 19 11:44:43 saturn kernel: [39043.140116] sd
> 3:0:0:0: [sdd] Starting disk
> > May 19 11:44:43 saturn kernel: [39043.150889] sd
> 5:0:0:0: [sde] Starting disk
> > May 19 11:44:43 saturn kernel: [39043.165729] PM: thaw
> of devices complete after 756.642 msecs
> > May 19 11:44:43 saturn kernel: [39043.322491] PM:
> Saving image data pages (809839 pages) ... done
> > May 19 11:44:43 saturn kernel: [39094.461575] PM:
> Wrote 3239356 kbytes in 51.13 seconds (63.35 MB/s)
> > May 19 11:44:43 saturn kernel: [39094.465739] PM: S
> > May 19 11:44:43 saturn kernel: [39094.482407] PM: Swap
> header not found!
> > May 19 11:44:43 saturn kernel: [39094.485188] |
> > May 19 11:44:43 saturn kernel: [39094.706731]
> Restarting tasks ... done.
> > May 19 11:44:43 saturn NetworkManager[1501]:
> wake requested (sleeping: yes=A0 enabled:
> yes)
> > May 19 11:44:43 saturn NetworkManager[1501]:
> waking up and re-enabling...
> > May 19 11:44:43 saturn NetworkManager[1501]:
> (eth0): now managed
>=20
> I've never used hibernation, but a quick Google search
> gives lots of
> information on this.=A0 Google "linux swap file
> hibernate".=A0 I read one
> thread from 2008, in which folks easily solved this with a
> kernel update
> or switching the filesystem where they stored the swap
> file.=A0 I would
> think 3 years later any bugs in the hibernation code have
> been squashed
> and this should work flawlessly.
>=20
> What kernel/distro version are you running?=A0 Anything
> recent should be
> able to handle hibernation to a swap file.
>=20
> --=20
> Stan
>=20
Hibernation mostly worked (almost all problems were associated with the=
Radeon video drivers) when I was using the RAID-6 swap partition. So =
I was not anticipating any new problem with hibernations.
I am using Fedora 14 with all the latest patches applied.
$ uname -a
Linux saturn 2.6.35.13-91.fc14.x86_64 #1 SMP Tue May 3 13:23:06 UTC 201=
1 x86_64 x86_64 x86_64 GNU/Linux
Cheers,
Gavin
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 19.05.2011 05:28:02 von Stan Hoeppner
On 5/18/2011 9:50 PM, Gavin Flower wrote:
> Hibernation mostly worked (almost all problems were associated with the Radeon video drivers) when I was using the RAID-6 swap partition. So I was not anticipating any new problem with hibernations.
>
> I am using Fedora 14 with all the latest patches applied.
>
> $ uname -a
> Linux saturn 2.6.35.13-91.fc14.x86_64 #1 SMP Tue May 3 13:23:06 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
Did you modify grub accordingly since switching from swap partition to
file, and reboot? My very basic understanding, after reading a single
Google hit, is that hibernation to/from swap has a dependency on a grub
entry. Thus, the problem you have now is not due to switching to a swap
file per se. It's due to the hibernation code not automatically
recognizing you did so.
Did you read any of the Google search results? All of the answers you
need should be there, or not far away.
--
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 19.05.2011 06:05:03 von Gavin Flower
--- On Thu, 19/5/11, Stan Hoeppner wrote:
> From: Stan Hoeppner
> Subject: Re: Best way to create RAID-6 for swap partition - existing =
one failed
> To: "Gavin Flower"
> Cc: linux-raid@vger.kernel.org, neilb@suse.de, mb@gem.win.co.nz
> Date: Thursday, 19 May, 2011, 15:28
> On 5/18/2011 9:50 PM, Gavin Flower
> wrote:
>=20
> > Hibernation mostly worked (almost all problems were
> associated with the Radeon video drivers) when I was using
> the RAID-6 swap partition.=A0 So I was not anticipating
> any new problem with hibernations.
> >=20
> > I am using Fedora 14 with all the latest patches
> applied.
> >=20
> > $ uname -a
> > Linux saturn 2.6.35.13-91.fc14.x86_64 #1 SMP Tue May 3
> 13:23:06 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
>=20
> Did you modify grub accordingly since switching from swap
> partition to
> file, and reboot?=A0 My very basic understanding, after
> reading a single
> Google hit, is that hibernation to/from swap has a
> dependency on a grub
> entry.=A0 Thus, the problem you have now is not due to
> switching to a swap
> file per se.=A0 It's due to the hibernation code not
> automatically
> recognizing you did so.
>=20
> Did you read any of the Google search results?=A0 All of
> the answers you
> need should be there, or not far away.
>=20
> --=20
> Stan
I looked at some Google results (see below), and have decided to revert=
to using a partition. As it is rapidly getting into more complication=
s than I have time to pursue. =20
This is far from the '60 second change' you promised :-)
Cheers,
Gavin
///////////
Red Hat Bug 466408 is an RFE to support using a swap file.
In /etc/rc.d/rc.sysinit there are lines that expect a swap partition:
[...]
# Start up swapping.
update_boot_stage RCswap
action $"Enabling /etc/fstab swaps: " swapon -a -e
if [ "$AUTOSWAP" =3D "yes" ]; then
curswap=3D$(awk '/^\/dev/ { print $1 }' /proc/swaps | while read x; do=
get_numeric_dev dec $x ; echo -n " "; done)
swappartitions=3D$(blkid -t TYPE=3Dswap -o device)
if [ x"$swappartitions" !=3D x ]; then
for partition in $swappartitions ; do
[ ! -e $partition ] && continue
majmin=3D$(get_numeric_dev dec $partition)
echo $curswap | grep -qw "$majmin" || action $"Enabling local swap p=
artitions: " swapon $partition
done
fi
fi
[...]
http://www.fedoraforum.org/forum/showthread.php?t=3D204114
[...]
Old 19th November 2008, 04:00 PM
stevea
[...]
I suspect that you cannot resume from a swap file without redesigning m=
kinitrd script. It currently resumes the swap (device or file) BEFORE i=
t mounts the root file system, so I think the resume/unhibernate is des=
tined to fail from a swap file. If you did mount the root first then yo=
u'd likely have a problem (fsck - unclean unmount) w/ the remounting th=
at fs later (maybe not - it's read access only). Maybe the resume could=
work from a file, but that's unclear.
[...]
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" i=
n
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing one failed
am 19.05.2011 10:17:37 von Stan Hoeppner
On 5/18/2011 11:05 PM, Gavin Flower wrote:
> I looked at some Google results (see below), and have decided to revert to using a partition. As it is rapidly getting into more complications than I have time to pursue.
Linux can do that, from time to time. :) :(
> This is far from the '60 second change' you promised :-)
I said you could deactivate your swap partition and make+activate a swap
file in less than 60 seconds, which is true. I never mentioned anything
about it working with suspend/resume. You're the fool who hibernates a
machine with a software RAID array for Pete's sake. ;) Why are you
suspending such a machine, out of curiosity? Surely it's not a laptop.
Does it really save that much on the power bill?
A little more research shows this does work for many distros, not so
well for some others. To make it work one must install uswsusp and
configure it. This is what allows the kernel to suspend to a swap file
instead of a partition.
--
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Best way to create RAID-6 for swap partition - existing onefailed
am 19.05.2011 11:04:38 von Gordon Henderson
On Wed, 18 May 2011, Stan Hoeppner wrote:
> There is little performance difference between swap files and swap
> partitions with modern kernels. The kernel will map the disk location
> of the swap file and perform direct disk access, bypassing the
> filesystem and buffer cache.
While this is true, sometimes it's handy to know why we did things a
certian way... so ....
In the olden days (when *everything* was expensive, so you optimised it
all!), we'd partition disks for many reasons, and one of them was
efficiency and speed, so you'd look to having the swap partition in an
area of the disk that was physically close to other areas you were using -
of-course this would vary depending on the applications being run - but a
typical layout might have root, then swap then /usr, or root, /usr, swap
then /home (or /var) the idea being to minimise head movement.
So a typical (but maybe now old style) multi-user environment, people
would be running programs from /usr, storing data in /home, so if the swap
were physically in-between those areas, there was a good chance of
minimising disk head movement, and thus making it go faster...
Partitions also helped to minimise data loss in the days when a head-crash
was a real possibility, and it kept fsck times down, or at least
managable..
I think we've lost a possibly quite a bit of efficiency with all the
dynamic re-mapping of disk sectors and logical addressing rather than
knowing exactly where on a disk a sector is (in cylinder, head, sector
notation), but that's progress for you, and flash/ssd's are going to
eliminate all that really old nonsense totally!
Of-course, in these enlightened days, no-one believes a word of it ...
I have a server with 5 disks in a RAID-6 configuration with swap on a
RAID-6 partition. Mostly because RAID10 was in it's infancy when I
installed it some 4+ years ago. It's due for retirement now though...
Gordon
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: Best way to create RAID-6 for swap partition - existing one failed
am 20.05.2011 05:32:31 von Leslie Rhorer
> -----Original Message-----
> From: linux-raid-owner@vger.kernel.org [mailto:linux-raid-
> owner@vger.kernel.org] On Behalf Of Stan Hoeppner
> Sent: Wednesday, May 18, 2011 9:26 PM
> To: Gavin Flower
> Cc: linux-raid@vger.kernel.org; neilb@suse.de; mb@gem.win.co.nz
> Subject: Re: Best way to create RAID-6 for swap partition - existing one
> failed
>
> On 5/18/2011 7:11 PM, Gavin Flower wrote:
>
> We're getting pretty OT here...
>
> > What obvious thing have I done, or not done, here?
> >
> > What should I do now?
> >
> > (I am not panicking, because I can always revert back...)
> >
> > I tried to implement you suggestion,
> >
> > # swapoff -a
> > # dd if=/dev/zero of=/swapfile1 bs=1K count=16M
> > 16777216+0 records in
> > 16777216+0 records out
> > 17179869184 bytes (17 GB) copied, 119.642 s, 144 MB/s
> > # mkswap /swapfile1
> > Setting up swapspace version 1, size = 16777212 KiB
> > no label, UUID=9afbf206-9a79-45b8-ad4b-148f71c440d7
>
> 17GB is a bit ridiculous for swap, especially on a single user machine.
I once encountered an fsck that required more than 400G. I had to
kill the process, slot a new 500G drive, and enable swap on the new drive.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html