LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-10-2010, 11:45 AM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Rep: Reputation: 77
Question Swap Fails on Boot Up


Maybe what I am trying to do doesn't work but let me explain. I have two identical drives on my PC.

/dev/sda = 1 TB
/dev/sdb = 1 TB

I wanted to mirror the drives so I created two separate partitions on each drive:

sda1 = 1024 MB (Swap)
sda2 = 999 GB (Software RAID)

sdb1 = 1024 (Swap)
sdb2 = 999 GB (Software RAID)

I then only created /dev/md0 which consist of /dev/sda2 & /dev/sdb2 in RAID 1 mirror.

When I boot the system, I show that Swap fails during boot in bright 'red' letters. I don't know if it failed activating both or just any swap partitions in general. When I look at 'df -h' while my system is booted, I show:

Code:
[root@buster ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
udev                   10M  168K  9.9M   2% /dev
/dev/md0              997G  847M  992G   1% /
shm                   997M     0  997M   0% /dev/shm
Does this mean that only 1 swap partition activated successfully and the 2nd one failed? Should I mirror the two swap partitions into /dev/md1?

Please help!
 
Old 09-10-2010, 12:11 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
df doesn't show information about swap. The /dev/shm is a special mount for shared memory.

To see swap information type "swapon -s".

For swap partitions to work:
1) When you create the partition it must be identified as swap (not Linux RAID Autodetect like your other partition).
2) mkswap has to be run on the device to make it a swap device.
3) The device has to be added as swap with the swapon command (if done after the system is up) and/or added to /etc/fstab to make it be enabled as swap at boot for example
/dev/sda1 swap swap defaults 0 0
/dev/sdb1 swap swap defaults 0 0

Last edited by MensaWater; 09-10-2010 at 12:18 PM.
 
Old 09-10-2010, 05:30 PM   #3
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Arch
Posts: 2,905

Original Poster
Rep: Reputation: 77
I checked as you noted and I don't see any active 'swap' partitions active...

Code:
[root@buster ~]# swapon -s
Filename				Type		Size	Used	Priority
How do you recommend I fix this problem?
 
Old 09-13-2010, 01:32 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
As noted in my post:

You have to make sure the partition type is linux swap (type fdisk -l to see all your partitions). If they're not you can use fdisk to change them (type "man fdisk" for details).

You have to use the mkswap to format them as swap devices (type "man mkswap" for details").

You can use the swapon command to enable them if the system is up already after you've created them as noted above. (See "man swapon" for details).

Add them to /etc/fstab as noted above to insure they get re-enabled on reboot.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SWAP - having trouble with swap auto mounting at boot lostdj Linux - General 2 08-05-2008 12:47 PM
Fedora 7 upgrade fails with swap problem DavidMcCann Fedora - Installation 2 07-13-2007 04:16 AM
failed features: boot.shm boot.loadmodules boot.swap cccc SUSE / openSUSE 1 08-08-2005 07:23 AM
Swap fails to mount at boot Omni Arch 3 03-17-2004 09:09 AM
swap partition fails after recompile kernel IamDaniel Linux - General 7 01-08-2004 02:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:21 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration