PDA

View Full Version : Use Linux Swap Partition at Boot?



ewangr
08-02-2004, 11:51 AM
Am trying to get Knoppix running on a PII 266 machine that has over 500 Gigs of HD, but only 64 megs of RAM.

Knoppix sees only 48 megs of RAM on boot, which wouldn't be a problem if I could convince it to use the swap partition (/dev/hda2) I already setup with System Rescue CD. But while it looks for a Windows partition to create a swap file on, I can't see any way to tell knoppix to use the Linux swap partition. And since I don't have a copy of Windows, setting up a small unformatted FAT32 partition doesn't seem like a good idea.

Help, please.

mzilikazi
08-02-2004, 01:35 PM
It *should* use your linux swap. Dunno what System Rescue CD is but simply creating a partition for swap isn't enough. You must format it too. For example:

mkswap /dev/hda2

ewangr
08-02-2004, 03:53 PM
Well, I "thought" I had done that, but it's possible I just setup the partition.

Assuming it's setup correctly, you're saying it should automatically recognize the partition as available and use it? This is from the Live CD version (since I want to run that first before doing an HD Install).

I gather I might also want to use mem=64M to get Knoppix to recognize the full memory available - or is that only good for 128M?

Thanks!

gruntbuggly
08-02-2004, 08:31 PM
> Assuming it's setup correctly, you're saying it should automatically recognize the partition as available and use it?

The Live CD scans for swap partitions at every boot, and starts using any it finds. The following will sort you out:

mkswap /dev/hda2
<reboot>
cat /etc/fstab | grep hda2
cat /proc/swaps

The output from the third line will show what kind of format Knoppix thinks /dev/hda2 has. The fourth line will show what swap space is actually being used.

A. Jorge Garcia
08-02-2004, 11:06 PM
Speaking of PII 266s, I just recently encountered 2 PIIs that won't boot the latest KNOPPIX liveCD. When it scans for files on scd0, it can't find the file system and drops to a "limited KNOPPIX menu."

However, these PCs boot from my old 3.3, 3.2 and 3.1 CDs I have lying around. All the CDs were burned the same way on the same burner. This is really weird. I've never had a problem like this before. Is there something fundamentally different about the 3.4 file system on the liveCD?

BTW, one PC is a PII-266 with 159MB RAM and the other is a PII-350 with 64MB of RAM. On the 64MB PC, only 45MB are used for the ramdisk (using the pre 3.4 CDs that boot). Using a swap file, no matter how large, really dosn't spead things up much, it just allows KDE to start-up when it wouldn't otherwise. Also, I can't repartition the 6GB hdd with a swapfile on hda1, so how do I setup a swap partition the use qtparted and knoppix-installer on this dinosaur?

Stumped,
AJG

mzilikazi
08-03-2004, 01:53 AM
Speaking of PII 266s, I just recently encountered 2 PIIs that won't boot the latest KNOPPIX liveCD. When it scans for files on scd0, it can't find the file system and drops to a "limited KNOPPIX menu."

However, these PCs boot from my old 3.3, 3.2 and 3.1 CDs I have lying around. All the CDs were burned the same way on the same burner. This is really weird. I've never had a problem like this before. Is there something fundamentally different about the 3.4 file system on the liveCD?

BTW, one PC is a PII-266 with 159MB RAM and the other is a PII-350 with 64MB of RAM. On the 64MB PC, only 45MB are used for the ramdisk (using the pre 3.4 CDs that boot). Using a swap file, no matter how large, really dosn't spead things up much, it just allows KDE to start-up when it wouldn't otherwise. Also, I can't repartition the 6GB hdd with a swapfile on hda1, so how do I setup a swap partition the use qtparted and knoppix-installer on this dinosaur?

Stumped,
AJG

Old boxes and old cdrom drives.....what are ya gonna do. Doesn't Knoppix boot diffferently now w/ isolinux than it previously did?

As far as the catch-22 w/ the swapfile goes......simply boot knoppix to run level 2 and partition the drive w/ cfdisk. Of course one of those parts needs to be swap! It couldn't be easier. :)

A. Jorge Garcia
08-03-2004, 03:12 AM
Yes, I was going to try cfdisk in knoppix 2. However, I'd prefer to use qtparted so as not to loose the data on hda1, just resize it to make room for a swap partition on hda2 and a knoppix partition on hda3. Even so, I'll only be able to knoppix-installer 3.3!

Thanx,
AJG

eco2geek
08-03-2004, 06:28 AM
I recently ran Knoppix on an old P200 with 64M of RAM and an AMD K6/266 with 128M RAM. The trick to getting it to recognize the CD drive as /dev/scd0 is to use the "nodma" cheatcode on both computers.

On the P200, Knoppix stops in its tracks, annouces it doesn't have enough memory to run KDE, and offers to create a swap file on an existing partition (much like it creates a persistent home directory in a file).

If there's a FAT32 partition (or ext2/3) with 60M of space available, it'll work.

And it automatically finds it on the next boot.

So, no need to create a separate swap partition just to run the live CD.

ewangr
08-03-2004, 01:46 PM
FWIW, I had the swap partition but had not done a mkswap as was originally guessed. Silly me...

Per the other few comments here, I'm wondering if there is any benefit to making my swap larger to speed things up. Currently have 1 gig of the HD set to swap, but am thinking I might get better performance with 2 gig?

Was thinking of trying the alternate desktops as well, but I gather OpenOffice will only run under KDE, and I think that's the only Linux product that will let me read/write MS Word compatible files. Would love to find out I'm wrong on this.

Finally, anyone who could point me to a solution for getting my Linksys WUSB11 v2.8 (uses the Atmel chipse) recognized and working? I thought I saw that Knoppix already included this driver, but so far no luck getting the network up and running.

Thanks again for all the help!

A. Jorge Garcia
08-03-2004, 01:48 PM
Right, but you can't repartition hda1 with qtparted if you have a *.swp file in hda1.

I tried knoppix 2 on the 64MB PC and got 3.3 to boot. I could only get cfdisk to work here.

So I tried again without KNOPPIX 2. KNOPPIX wanted to setup a *.swp file, I said no. Then I could run qtparted. However, when I created the new partitions, they turned out to be only "logical" partitions, so I couldn't format them. Then knoppix-installer only found hda1, no bloody hda2, no bloody hda3.

Regards,
AJG

PS: nodma, hmmm....

mzilikazi
08-03-2004, 11:54 PM
FWIW, I had the swap partition but had not done a mkswap as was originally guessed. Silly me...

Per the other few comments here, I'm wondering if there is any benefit to making my swap larger to speed things up. Currently have 1 gig of the HD set to swap, but am thinking I might get better performance with 2 gig?

Nah won't make a difference. I always try to have 1G of RAM total i.e. system RAM + swap = 1G.


Was thinking of trying the alternate desktops as well, but I gather OpenOffice will only run under KDE, and I think that's the only Linux product that will let me read/write MS Word compatible files. Would love to find out I'm wrong on this.

Not true. OO has nothing to do w/ KDE except that they are both resource hogs. :)


Finally, anyone who could point me to a solution for getting my Linksys WUSB11 v2.8 (uses the Atmel chipse) recognized and working? I thought I saw that Knoppix already included this driver, but so far no luck getting the network up and running.

Thanks again for all the help!

No promises but slh has been doing some great work w/ atmel chipset drivers for Kanotix. You'd do well to ask slh about it directly. You can usually find him on #kanotix

mzilikazi
08-03-2004, 11:57 PM
Right, but you can't repartition hda1 with qtparted if you have a *.swp file in hda1.

Never heard of swapoff? ;)


I tried knoppix 2 on the 64MB PC and got 3.3 to boot. I could only get cfdisk to work here.

So I tried again without KNOPPIX 2. KNOPPIX wanted to setup a *.swp file, I said no. Then I could run qtparted. However, when I created the new partitions, they turned out to be only "logical" partitions, so I couldn't format them. Then knoppix-installer only found hda1, no bloody hda2, no bloody hda3.

Regards,
AJG

PS: nodma, hmmm....

Formatting a partition has absolutely nothing to do with whether the partition is primary or logical. Why not just backup your data on hda1? You could've been done and installed by now if not tinkering about w/ qtparted my friend.

A. Jorge Garcia
08-04-2004, 12:50 AM
I'm trying to help a friend with his old PC and don't want to mess with his WIN install. He has WIN98 on there with several apps and no way to reinstall them if they get lost (no install CDs). So I'd rather try a nondestructive repartition or nothing at all on that PC.

I've never had a problem with qtparted for this sort of setup. I'm wary about this old hardware if qtparted won't even repartition it properly.

BTW, yes, I know about noswap, but I was trying to get KDE to run too....

Regards,
AJG

mzilikazi
08-04-2004, 03:43 AM
I'm trying to help a friend with his old PC and don't want to mess with his WIN install. He has WIN98 on there with several apps and no way to reinstall them if they get lost (no install CDs). So I'd rather try a nondestructive repartition or nothing at all on that PC.


OOooohhhh well that complicates things doesn't it? Doesn't Knoppix have another wm you can use for partitioning purposes? icewm or fluxbox for example? qtparted will still run under icewm but you can utilize your scarce system resources for what matters instead of eye-candy. Worry about KDE when you install. Personally I would simply make a backup of everything and restore it if your resize goes south. Of course you've defragged that windows install till you're blue in the face right? Even win2k will tell you that your drive doesn't need to be defragged even though you can plainly see that it does. Well M$ standards always were below par right? :)

A. Jorge Garcia
08-04-2004, 03:55 PM
OK, I got the KNOPPIX 3.4 liveCD booting on this old PC with the nodma cheat code. Maybe we should start an internet radio show called "This Old PC?" Sorry, I couldn't resist....

With KNOPPIX 2 nodma I can only use cfdisk, a destructive partitioning tool.

With KNOPPIX vsync=60 nodma noswap I get the TWM windowmanager and qtparted runs but it only creates "virtual" partitions that cannot be formatted! Also, knoppix-installer won't run because it says the partitioning hasn't been done.

With KNOPPIX vsync=60 nodma (knoppix.swp is 128MB) I get KDE and qtparted runs but it cannot create any partitions!

Oh well, I give up on that PC. This is one for the history books. Never have I had to give up on any PC, new or old alike, when using KNOPPIX!

Regards,
AJG

mzilikazi
08-04-2004, 05:03 PM
With KNOPPIX vsync=60 nodma noswap I get the TWM windowmanager and qtparted runs but it only creates "virtual" partitions that cannot be formatted.

Can you use qtparted to shrink the existing partition then use cfdisk to make real partitions? What is a virtual partition anyway? Sorry.....never used qtparted and as it stands I still see no benefit to using it. Maybe that's just an incorrect impression of what the tool can do.

A. Jorge Garcia
08-04-2004, 05:57 PM
No, I tried that. Once I'm done creating partitions and exit qtparted, knoppix-installer claims no partitions other than hda1 exist. Likewise, cfdisk only sees the original 6GB hda1 WIMPdoze partition!

This is really driving me nuts. I tried to shrink hda1 to 1.5 GB. Then tried to create hda2 as a linux swap partition of 0.5 GB and hda3 as a linux ext3 partition. But when I go to format hda2 or hda3, qtparted hiccups "this is only a virtual partition and cannot be formatted," or some such error message. I never encountered this before!

BTW, qtparted is great, usually.... I've never had to use cfdisk since qtparted was included in KNOPPIX 3.3 (maybe late 3.2). You can do everything you do with cfdisk, but I never have to restore the resized partition from backup - all the original files are still there and working. I just think it saves me from hassles and wasted time.

"What's a virtual partition," I here you ask? Damned good question, I never heard of that either! I get active vs. passive partitions. I get primary vs. logical partitions. I don't get virtual partitions....

Regards,
AJG

A. Jorge Garcia
08-11-2004, 08:40 PM
OK, forget virtual partitions and that old PC.

Here's another hair twister. I found this old Gateway PII 266 with 159MB RAM in my attic. Now, this puppy has a fried keyboard/mouse port card and a dead hdd.

So, I found a usb mouse and a usb keyboard. I tried the KNOPPIX 3.4 liveCD but hit the dma problem again. Note, I can't issue any cheatcodes as the usb keyboard is not recognized until after the whole boot process!

So, I tried an old KNOPPIX 3.3 liveCD that apparently has nodma set as the default. It autodetects the usb mouse fine. And it autodetects the usb keyboard after a lot of insmod probe errors. Long story short, I got this puppy up and running, on the net, et. al.

But there's still one problem: this stupid PC autosleeps no matter if you are using the thing or not in about 5 minutes and nothing I do, short of rebooting the whole mess again, wakes it up! What do I do to turn sleep off???

TIA,
AJG

mzilikazi
08-12-2004, 12:23 AM
But there's still one problem: this stupid PC autosleeps no matter if you are using the thing or not in about 5 minutes and nothing I do, short of rebooting the whole mess again, wakes it up! What do I do to turn sleep off???

TIA,
AJG

maybe.........

xset -dpms

OR

killall apmd

A. Jorge Garcia
08-12-2004, 01:10 AM
OK, I'm not at home to test this, but xset -dpms and killall apmd sound promising! How about apmd stop?

BTW, do these commands have to have to be issued from a roor shell or will a regular shell do? Also, that's all well and good for me, but is there something "gui," say a kde utility that will work too. My users are not too linux savvy....

TIA,
AJG

mzilikazi
08-12-2004, 01:15 AM
OK, I'm not at home to test this. But xset -dpms and killall apmd sound promising! How about apmd stop?

/etc/init.d/apmd stop


BTW, do these commands have to have to be issued from a roor shell or will a regular shell do?

Well yes you'd need to issue those commands as root.


Also, that's all well and good for me, but is there something "gui," say a kde utility that will work too. My users are not too linux savvy....

TIA,
AJG

kde? gui?? I haven't the foggiest idea what you're talking about. :)

A. Jorge Garcia
08-12-2004, 01:58 AM
1st try: I tried xset -dpms in a regular shell. The command was recognized with no errors but it didn't help the problem.

2nd try: I tried killall apmd in a regular shell. The command was not permitted.

3rd try: I tried sudo killall apmd in a regular shell. The command was recognized with no errors but it didn't help the problem.

4th try: I tried apmd stop in a regular shell. The command was not permitted.

5th try: I tried sudo apmd stop in a regular shell. The command was not permitted.

6th try: I tried /etc/init.d/apmd stop in a root shell. The command was recognized with no errors but it didn't help the problem.

7th try: I tried xset -dpms in a root shell. The command was recognized with no errors but it didn't help the problem.

8th try: I tried killall apmd in a root shell. The command was recognized with no errors but it didn't help the problem.

No joy so far, nothing seems to work!!!

Regards,
AJG

eco2geek
08-12-2004, 02:36 AM
"What's a virtual partition," I here you ask? Damned good question, I never heard of that either! I get active vs. passive partitions. I get primary vs. logical partitions. I don't get virtual partitions....

I'm not close to a Knoppix box right now, but in my experience you have to use the "commit" menu command in QTParted to write your changes to your hard disk. Otherwise you get error messages about "virtual partitions." Also, your changes do not automatically take effect until you use the "commit" command.

mzilikazi
08-12-2004, 03:01 AM
No joy so far, nothing seems to work!!!

Regards,
AJG

You might check to see if apmd or acpid is even running first:

ps aux|grep apm
ps aux|grep acpi

I should *think* that one of those daemons should be responsible. I suggest apm only because I imagine that your box is too old to use acpi but I'm wrong at least twice a day. :roll:

Since you're effectively 'keyboardless' at boot perhaps it's possible to create a persistent home that passes noapm or noapic or acpi=off on boot? (Sorry not too familiar w/ the persistent home feature). It now dawns on me that perhaps you need a kb to use the persistent home as well......I dunno.

A. Jorge Garcia
08-12-2004, 04:01 AM
I'm not close to a Knoppix box right now, but in my experience you have to use the "commit" menu command in QTParted to write your changes to your hard disk. Otherwise you get error messages about "virtual partitions." Also, your changes do not automatically take effect until you use the "commit" command.

Actually that sounds like the "write the partition table (y/n)" option in cfdisk. I may be wrong, but I've used qtparted a lot and don't recall this "commit" option. Thanx anyway, eco!

EDIT: Hey, eco, you may be on to something, after all! I just ran qtparted and found this "commit" option. Is this a new version or something? I don't recall ever needing to do this.... I'm going to have to dig that PC out of the garage again and try this out! Thanx again, eco!!

Regards,
AJG

A. Jorge Garcia
08-12-2004, 04:04 AM
It now dawns on me that perhaps you need a kb to use the persistent home as well......I dunno.

I think you're right. There's some cheatcode like myscan or somesuch....

I've never used persistent home as the default KNOPPIX config is usually fine for my users. If they need something special, they can use an hd install or ssh over to one.

Thanx for all your help though! I like all this brainstorming, that's what usually gets the job done! Thanx, mzilikazi!

Regards,
AJG

A. Jorge Garcia
08-12-2004, 04:20 AM
ps aux|grep apm
ps aux|grep acpi


I tried these commands in the root shell. The first returned something like


/usr/sbin/apmd -P ...

the second returned nothing. So its apm that I'm running after all.

Regards,
AJG

A. Jorge Garcia
08-12-2004, 04:01 PM
eco,

I dragged that thing out of the garage (my friend dumped it here) and tried everything all over again with the "commit" option. Unfortunately, commit returns an error about the free space reported being wrong. Forget it, there must be something really wrong with this hdd! Maybe I could find one with which to swap it out....

Good try, though!

Thanx anyway,
AKG