LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 11-21-2009, 04:23 PM   #1
tunkaflux
LQ Newbie
 
Registered: Apr 2003
Posts: 10

Rep: Reputation: 0
RAID1 swap disappearing?


Hello,

I've got a server with Slackware64 13.0 installed. It has 2 disks in it configured for RAID1 (1 root partition & 1 swap partition on each disk in RAID1: /dev/md0 & /dev/md1). For some reason, the box became unresponsive and after I rebooted it, swap seems to be gone. There's no /dev/md1 anymore and for some reason Slack is resyncing /dev/md0 starting from 0%...
I was not able to find any specific errors in the log files.

Does anyone have an idea on why /dev/md1 is gone and why it's resynching /dev/md0?

Tnx
 
Old 11-21-2009, 08:28 PM   #2
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 226Reputation: 226Reputation: 226
Normally you don't raid your swap partitions.

You set the swap partitions to type 82 and add them to fstab as normal.

Something like this

Code:
/dev/sdc1        swap             swap        pri=1            0   0
/dev/sdd1        swap             swap        pri=1            0   0
/dev/md0         /                ext3        defaults         1   1
You can check the status of your raid with
Code:
mdadm -D /dev/md[01]
 
Old 11-22-2009, 03:12 AM   #3
tunkaflux
LQ Newbie
 
Registered: Apr 2003
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by mRgOBLIN View Post
Normally you don't raid your swap partitions.

You set the swap partitions to type 82 and add them to fstab as normal.

Something like this

Code:
/dev/sdc1        swap             swap        pri=1            0   0
/dev/sdd1        swap             swap        pri=1            0   0
/dev/md0         /                ext3        defaults         1   1
You can check the status of your raid with
Code:
mdadm -D /dev/md[01]
In this case, what happens when swap is in use and one of the disks fails?
 
Old 11-22-2009, 03:32 AM   #4
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474
Blog Entries: 28

Rep: Reputation: 34
RAID0: To get a faster swap...

Quote:
Originally Posted by mRgOBLIN View Post
Normally you don't raid your swap partitions.
Actually, you can RAID your swap partitions. I almost always use swap on RAID. But you should be using RAID0 instead for speed. The more disks you have in your RAID0 swap, the faster your system will be. And preferably, put those partitions on the outer edges of your disks, which are moving faster to give decreased access times. Swap doesn't need redundancy. But it does benefit from the increased speed that RAID0 will give you.

Xavian-Anderson Macpherson
Shingoshi
 
Old 11-22-2009, 04:09 AM   #5
tunkaflux
LQ Newbie
 
Registered: Apr 2003
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Shingoshi View Post
Actually, you can RAID your swap partitions. I almost always use swap on RAID. But you should be using RAID0 instead for speed. The more disks you have in your RAID0 swap, the faster your system will be. And preferably, put those partitions on the outer edges of your disks, which are moving faster to give decreased access times. Swap doesn't need redundancy. But it does benefit from the increased speed that RAID0 will give you.
Ok, but I don't care about speed, I care about reliability, stability & uptime What happens when 1 disk, which contains parts of your RAID0 swap, completely fails whilst this is in use?
 
Old 11-22-2009, 04:22 AM   #6
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474
Blog Entries: 28

Rep: Reputation: 34
If that's what you value most...

Quote:
Originally Posted by tunkaflux View Post
Ok, but I don't care about speed, I care about reliability, stability & uptime What happens when 1 disk, which contains parts of your RAID0 swap, completely fails whilst this is in use?
Then I would definitely say go ahead and use it. Because it is a good point. If you have more than two disks, then use RAID5. You'll have your redundancy and speed along with it.

Xavian-Anderson Macpherson
Shingoshi
 
Old 11-22-2009, 05:41 AM   #7
tunkaflux
LQ Newbie
 
Registered: Apr 2003
Posts: 10

Original Poster
Rep: Reputation: 0
In the meantime, /dev/md0 (root) has resynced and after that it seems /dev/md1 has also resynced (swap).

However, swap was not automatically turned on, I had to manually do "swapon -a". Is this normal?
 
Old 11-22-2009, 09:44 AM   #8
tux_dude
Member
 
Registered: Dec 2008
Distribution: Slackware64 Current
Posts: 225

Rep: Reputation: 33
How is the raid drive setup? Are these IDE, sata or scsi? What type of drives are they? You should check if there are any know issues with the drives and RAID.

Is seems one of the drive stops responding causing mdadm to treat it as a failure. This can occur if the drive goes to sleep, become non-responsive when flushing cache (Seagate had the problem) or on the same IDE cable. Run a full smartctl on both disks. You can then use hdparm to tweak the drive settings.
 
Old 11-22-2009, 09:01 PM   #9
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 226Reputation: 226Reputation: 226
Quote:
Originally Posted by Shingoshi View Post
Actually, you can RAID your swap partitions. I almost always use swap on RAID. But you should be using RAID0 instead for speed.
Shingoshi
What a load of....

I never said you couldn't swap on raid...

If you are headed into swap why would you add the overhead of raid0 onto that for no benefit?

Setting the swap priority the same for each partition will let the kernel "stripe" across the swap partitions... and is way more efficient.

Quote:
Originally Posted by tunkaflux View Post
In this case, what happens when swap is in use and one of the disks fails?
It's called a "Really Bad Day"(TM). =)

Yes it could crash the machine but after a re-boot, your system should come back fine. (less that swap partition).

If uptime is extremely important then of course raid the swap (just don't use raid0). You might also be better off looking at proper battery backed hardware raid too.
 
Old 11-22-2009, 09:32 PM   #10
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474
Blog Entries: 28

Rep: Reputation: 34
Do you feel like a BIGGER man now??

Quote:
Originally Posted by mRgOBLIN View Post
What a load of....

I never said you couldn't swap on raid...

If you are headed into swap why would you add the overhead of raid0 onto that for no benefit?

Setting the swap priority the same for each partition will let the kernel "stripe" across the swap partitions... and is way more efficient.
Was it that difficult to say this without being insulting? Frankly I knew nothing about the swap priority. I missed the information you gave about setting the swap priority in your first post. Thanks for having posted it! Hopefully others won't miss it also.

EDIT: I have now followed your good advice!
1.) I first had to "swapoff -a" to dump all memory.
2.) Then I went into Webmin and deleted those partitions.
3.) Followed by reformatting them as Linux 82 (Hardware/Partitions on Local Disks),...
4.) and remounting and activating them in the "Disk and Network Filesystems" tab under System.

Works fine now as you can see.
Code:
sh-4.0# free -mlt
             total       used       free     shared    buffers     cached
Mem:          7720       7429        291          0          0       1552
Low:          7720       7429        291
High:            0          0          0
-/+ buffers/cache:       5875       1845
Swap:         3812          0       3812
Total:       11533       7429       4103
Xavian-Anderson Macpherson
Shingoshi

Last edited by Shingoshi; 11-22-2009 at 10:08 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to swap out (to swap area) page frames a process use? entertainyou Linux - Kernel 3 03-23-2011 09:52 PM
Converting existing RAID1 (where /root, /swap, /usr, and /var reside) to RAID10 the_answer_is_no Linux - Newbie 5 06-02-2008 09:17 AM
Have software raid1, but like to change to raid1+0 or 0+1, how? spaceuser Debian 8 03-17-2008 02:07 PM
Linux swap / solaris not appearing as swap in Ubuntu? Erik_the_Red Linux - Newbie 1 07-30-2005 12:57 PM
How to unmount actual swap and mount a new(bigger) swap space? isaac Linux - Newbie 1 06-06-2004 01:23 AM


All times are GMT -5. The time now is 05:11 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration