Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-29-2007, 10:41 PM
|
#1
|
Member
Registered: Sep 2006
Location: Tucson, Az.
Distribution: hardy heron
Posts: 111
Rep:
|
linux swap partition problem
P4, 2 80gb drives in raid1, 1gb mem
Had a bad swap partition on one drive. Using gparted I copied a good swap to the bad drive. Neither swap partition is active now. Tried swapon from gparted as well as the console and got a "invalid argument" each time.
I have no swap and my system is struggling. How do I activate these swap partitions?
Sure could use some help.....
|
|
|
10-29-2007, 11:14 PM
|
#2
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep: 
|
You have a whole gig of ram and your system needs swap??
# echo 0 > /proc/sys/vm/swappiness
Of course, while this is probably what you need, it doesn't answer your question.
Quote:
Had a bad swap partition on one drive.
|
What was it about the partition that made it "bad"?
Quote:
Using gparted I copied a good swap to the bad drive.
|
"copied"?? Why not use gparted to re-create the swap partition?
Quote:
Neither swap partition is active now.
|
... this is a real puzzle. Have you seen:
http://lissot.net/partition/partition-08.html
... check your /etc/fstab against fdisk -l to make sure the swap partitions are correctly entered. (Show me if you got confused or uncertain.)
If you really need swap, then you should create a swap file while troubleshooting.
dd if=/dev/zero of=/var/my_swap bs=1024 count=131072
and activate it
mkswap -f /var/my_swap
swapon /var/my_swap
|
|
|
10-29-2007, 11:30 PM
|
#3
|
Senior Member
Registered: Jan 2006
Posts: 4,363
Rep: 
|
A lot of us with 2gb of ram still need swap. It just depends on what you are doing.
Other than that I am with Simon.
|
|
|
10-30-2007, 12:54 AM
|
#4
|
Member
Registered: Sep 2006
Location: Tucson, Az.
Distribution: hardy heron
Posts: 111
Original Poster
Rep:
|
I'm sure I am confusing things. Here is what I know. My screen on occasion would gray out while an operation was going on and if you watched the system monitor in the upper panel it would be full. When the system caught up the gray would go away. I wondered what was going on thus I ran gparted to check out my Raid drives. /dev/sda showed that there was an alert symbol in the swap partition. Basically the swap partition was not in use or corrupt. The other drive was ok. I experimented and copied the "good" swap partition in /dev/sdb to /dev/sda. Confused yet? Now both partitions will not respond to the swapon command and issue a "invalid argument.
So I'd like to return the system to normal.
Why swap? That is how someone set it up for me.
See below;
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00051b2f
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6687 53713296 fd Linux raid autodetect
/dev/sda2 6688 9605 23438835 fd Linux raid autodetect
/dev/sda3 9606 9702 779152+ 82 Linux swap / Solaris
Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 6687 53713296 fd Linux raid autodetect
/dev/sdb2 6688 9605 23438835 fd Linux raid autodetect
/dev/sdb3 9606 9702 779152+ fd Linux raid autodetect
Disk /dev/md0: 55.0 GB, 55002333184 bytes
2 heads, 4 sectors/track, 13428304 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
Disk /dev/md1: 24.0 GB, 24001249280 bytes
2 heads, 4 sectors/track, 5859680 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000
Disk /dev/md1 doesn't contain a valid partition table
|
|
|
10-30-2007, 06:08 PM
|
#5
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep: 
|
There is only one swap partition in there dude. Check with /etc/fstab to see how it is mounted.
Quote:
Now both partitions will not respond to the swapon command and issue a "invalid argument.
|
Use
swapoff -a then swapon -a
Quote:
the system monitor in the upper panel it would be full
|
... hmmm, in my system monitor, the upper panel is for CPU useage. The middle panel is memory with a trace for swap and another for RAM. Mine is sitting around 50% swap and 70% RAM (512MiB) and the cpu barely cracks 2% with swappiness 10.
But what you seem to be reporting is max cpu load, not maxed out swap. However, if you see maxed out RAM and no swap use... make a swap file to use in the interim.
Quote:
Disk /dev/md1 doesn't contain a valid partition table
|
But, basically: you need to repair your RAID.
The purpose of your RAID appears to be to increase read/write speed on a single drive. Now it is bad, this speed will be incredibly slow.
Maintaining Linux RAID
http://www.samag.com/documents/s=910...404a/0404a.htm
Related thread
http://www.linuxquestions.org/questi...-linux-412510/
I normally encorage a rethink about why you need RAID.
Last edited by Simon Bridge; 10-30-2007 at 06:10 PM.
|
|
|
10-31-2007, 09:09 AM
|
#6
|
Member
Registered: Sep 2006
Location: Tucson, Az.
Distribution: hardy heron
Posts: 111
Original Poster
Rep:
|
Actually I would like to revert to a single drive with some sort of scheme to use the second drive as a backup. Perhaps there is a howto that would assist me in doing that.
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/md0 / ext3 defaults,errors=remount-ro 0 1
/dev/md1 /dvdbackup ext3 defaults 0 1
/dev/md2 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/scd1 /media/dvd+rw udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
/dev/sda /media/usb0 auto rw,user,noauto 0 0
/dev/sdb /media/usb1 auto rw,user,noauto 0 0
Last edited by rgreeves; 10-31-2007 at 09:21 AM.
|
|
|
11-01-2007, 11:42 AM
|
#7
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep: 
|
Yeah - you backup and reinstall.
I've been lazy and run cp with the archive flag to backup my /home directory. Used to have a more elaborate method involving tar, which supports incremental backups too.
Good luck.
|
|
|
11-04-2007, 10:21 PM
|
#8
|
Member
Registered: Sep 2006
Location: Tucson, Az.
Distribution: hardy heron
Posts: 111
Original Poster
Rep:
|
actually, is there a way to get the swap working on one drive then I can reformat the other one?
|
|
|
11-05-2007, 06:19 AM
|
#9
|
LQ Guru
Registered: Jan 2002
Posts: 6,042
Rep: 
|
If you are trying to reconstruct the data of the swap partition. Forget it. Just run mkswap on the swap partition and then use swapon to activate the swap partition. To ease mounting swap partitions or any other partition from a SCSI drive, I suggest specify a label while formating.
If the partition table information has strange start and end values for the swap partition, then backup the data on all partitions and edit the partitions.
If someone setup for you, then they do not know anything about Linux. For one thing software RAID from the controller is not reliable and stable in Linux. I recommend use Linux software RAID instead. The CD drive is /dev/hdX or /dev/sdX. A device node /dev/scd is the old way using SCSI emulation for IDE optical drives. Also USB storage devices needs a partition number because it can not mount RAW partitions such as /dev/sda. I do not recommend including USB and IEEE-1394 storage mediums in /etc/fstab because it will create confusion and unpredictable problems. I recommend use dbus, hal, or udev to help mount USB and IEEE-1394 storage devices.
|
|
|
11-18-2007, 02:51 PM
|
#10
|
Member
Registered: Sep 2006
Location: Tucson, Az.
Distribution: hardy heron
Posts: 111
Original Poster
Rep:
|
this was a software raid1 setup. dev/sda swap partition went bad. I replaced it by deleting the bad one and using gparted replaced it. The new swap partition is not showing it as being a raid swap partition. Confused? Me too.
see below
$ cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md2 : active raid1 sda3[1]
779072 blocks [2/1] [_U]
md1 : active raid1 sda2[0] sdb2[1]
23438720 blocks [2/2] [UU]
md0 : active raid1 sda1[0] sdb1[1]
53713216 blocks [2/2] [UU]
unused devices: <none>
Last edited by rgreeves; 11-18-2007 at 02:53 PM.
|
|
|
All times are GMT -5. The time now is 09:28 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|