Linux - HardwareThis 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.
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.
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?
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
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
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.