LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Telling Linux what to use as its swap partition (https://www.linuxquestions.org/questions/fedora-35/telling-linux-what-to-use-as-its-swap-partition-272663/)

timelord726 01-01-2005 03:42 PM

Telling Linux what to use as its swap partition
 
How can I get Linux to recognize its swap partition? Somehow, the information became lost, and it does not realize it has a 1 GB swap partition set aside for it. This is bad, because setup will not let me upgrade to Fedora Core 3 without a swap partition. I have one, but my Core 3 Test 1 install does not recognize it anymore. Little help anyone?

Thanks!

SlackerLX 01-01-2005 04:14 PM

First of all swap partition must be formated as swap hextype is 82
Secondly you enable it by typing "swapon"
Just an example:
$mkswap /dev/hda2
$swapon /dev/hda2

michaelk 01-01-2005 04:16 PM

First do you know what partition your swap should be? Log in as root and enter the follow command:
fdisk -l (that is a small L)

Check the /etc/fstab file and see if it matches. Look for
/dev/hdxy swap swap defaults 0 0 (or similar). Where xy is the drive a partition ID.

Look at the output of the free command. If total swap space is 0 then it isn't activated.
To activate swap
swapon /dev/hdxy (again replace xy with the ide of thepartition)

If your getting errors activating the drive then you can reformat swap with the command.
mkswap /dev/hdxy

The try a swapon command again. Check the output of the free command to see if everything is working.

timelord726 01-01-2005 04:32 PM

Thanks guys. Three problems.

First: No fdisk.
[root@pcp04376218pcs danny]# fdisk -l
bash: fdisk: command not found

I found the swap partition anyway, though. It's /dev/hdf6.

Second and third: No swapon or mkswap either.
[root@pcp04376218pcs danny]# swapon /dev/hdf6
bash: swapon: command not found
[root@pcp04376218pcs danny]# mkswap /dev/hdf6
bash: mkswap: command not found

Any pointers?

Thanks!

P.S. Running Fedora Core 3 Test 1, as mentioned above.

SlackerLX 01-01-2005 04:36 PM

Please, be sure that you enter commands like "fdisk" or "cfdisk" as superuser, in fact, CFDISK is easier to use
$su
<PW>
$cfdisk

timelord726 01-01-2005 04:40 PM

I am logged in as root. fdisk, cfdisk, swapon, and mkswap all come up with command not found errors.

SlackerLX 01-01-2005 04:46 PM

Easy solution is, of course, LiveCD, which has all options you need for lowformatting

timelord726 01-01-2005 05:01 PM

Is there another way to go through with this without LiveCD? Alternatively, how do I get LiveCD? (Alternate solution would be more appreciated.)

SlackerLX 01-01-2005 05:06 PM

OK. First answer to second question. Any distro as well as LiveCD my be downloaded free at http://distrowatch.com
Second, let us try again, shall we:
CTRL+ALT+F1
$login
<PW>
$cfdisk

syg00 01-01-2005 05:07 PM

Quote:

Originally posted by timelord726
I am logged in as root. fdisk, cfdisk, swapon, and mkswap all come up with command not found errors.
Sounds like you don't have your path set correctly.
Try /sbin/swapon /dev/????
fdisk and mkswap should also be in /sbin

SlackerLX 01-01-2005 05:10 PM

syg00 may be also right in this case.
Try what he wrote....:)

misc 01-01-2005 07:18 PM

Ah, come on, please. Log in as root correctly. That means, use su --login or the two short-forms su -l or su -, but don't use just "su". It's not enough. Then run:

parted /dev/hda print

timelord726 01-01-2005 07:30 PM

Quote:

Originally posted by misc
Ah, come on, please. Log in as root correctly. That means, use su --login or the two short-forms su -l or su -, but don't use just "su". It's not enough.
Wow, sorry, sir. You don't need to snap at people who don't know as much about Linux as you. The "su" command has worked for me in the past, so jeez. My sincere apologies for not being perfect.

I found and fixed the problem and am now confronted with a new one though. I recently installed a new hard drive, and for some reason it started looking for the swap partition in the same spot on the new drive. Fixed that, and both Linux and FC3 setup worked correctly. I got my installation upgraded to Fedora Core 3, but now whenever I boot it, it refuses to load at all.

It does:

Initializing hardware: network (something else I can't remember) audio [ OK ]

Then it does:

Configuring kernel parameters:

And just stops and won't boot past that. This problem just went from marginally annoying to very serious...

Thanks for your help.

SlackerLX 01-01-2005 07:38 PM

Quote:

Originally posted by timelord726

I found and fixed the problem and am now confronted with a new one though.
It does:

timelord726!
Please, take time to reply when the initial problem is fixed, because people keep posting regarding the initial one. We take time to help you - you take time to at least notify.

Regards;)

timelord726 01-01-2005 07:40 PM

Quote:

Originally posted by SlackerLX
timelord726!
Please, take time to reply when the initial problem is fixed, because people keep posting regarding the initial one. We take time to help you - you take time to at least notify.

Umm... I thought I just did that. I fixed it, and then I notified you as soon as I could. Do you expect me to just hop onto my cell phone and use its internet access to post on here when my computer is otherwise occupied? Once again, sorry for not being perfect...

SlackerLX 01-01-2005 07:45 PM

Jee, you've got some attitude...:jawa:
"....While boiling, liquid's flowing over edge,
Increase by view is only but in fact is damade"
W. Shakespeare


Patience is virtue

timelord726 01-01-2005 07:49 PM

Look, I'm sorry, but I did post as soon as I could. I took offense to what you said because I used the fix that was posted, applied it, then finished up what I started. After rebooting, it failed again, so I booted back into Windows, hopped back online, and posted what you read a few minutes ago. Now I have a new problem, and I hope for some help with it.

misc 01-01-2005 07:55 PM

Quote:

Wow, sorry, sir. You don't need to snap at people who don't know as much about Linux as you. The "su" command has worked for me in the past, so jeez. My sincere apologies for not being perfect.
Didn't mean to snap at anyone. ;) Just wondered that wrong usage of "su" spreads like a disease, although so many users run into that trap. Plain "su" is insufficient, because it doesn't enable superuser's environment, such as the PATH environment variable.

timelord726 01-01-2005 07:56 PM

Quote:

Originally posted by misc
Didn't mean to snap at anyone. ;) Just wondered that wrong usage of "su" spreads like a disease, although so many users run into that trap. Plain "su" is insufficient, because it doesn't enable superuser's environment, such as the PATH environment variable.
Thanks for responding, and I appreciate a lesson in Linux whenever I can get it. Difference between forms of "su" duly noted. :)

seabass55 01-01-2005 08:13 PM

Or perhaps the linux gurus could give noobs full paths to commands they want to run. So instead of "type fdisk /dev/hda" give them /sbin/fdisk/ just to make sure. Then maybe explain why the path is important for root and why you should type "su -" when wanting to run commands located in /sbin/. Happy New Year everyone...be happy!

misc 01-01-2005 08:23 PM

Well, you don't really want to remember whether a tool is in /bin, /usr/bin, /usr/sbin, /sbin, /usr/X11R6/bin or elsewhere. Further, specifying full path to programs is misleading as it's not necessary and should not look like it is.

seabass55 01-01-2005 08:32 PM

I beg to differ...

To fully understand an OS it's good to know what's in /bin and what's in /sbin. What if you're paths get screwed up? What if you're working on someone elses machine and their paths are different? Folks need to learn what's where.

Now don't get me wrong, I'm not saying EVERY post with a command it in should list the full path. But not everyone here is very familiar with linux and jumping on them because they don't know what su - does is not needed. Lots of people are intimidated enough with linux, coming to a forum is somehting many of us didn't have when we were learning linux and I think it's a great thing. My point in the first post was be friendly and explain things to the noobs...don't jump all over them when they don't do something right. We're here to help people...not scare them off.

misc 01-01-2005 08:56 PM

Quote:

To fully understand an OS it's good to know what's in /bin and what's in /sbin.
Only roughly, not more. Look at this:

$ ll /bin | wc -l
97
$ ll /sbin | wc -l
223

That's the number of files in those directories on this machine. It's beneficial to understand the purpose of the different bin directories. But you don't really care where exactly a tool is stored. When you know the distribution, you know the tool is installed by default and is available when you're logged in.

Quote:

What if you're paths get screwed up? What if you're working on someone elses machine and their paths are different?
Moot points. You can set PATH anytime you like. And a good admin doesn't alter the default superuser path when you are supposed to work in the same environment. Altering the paths doesn't make sense if program locations are not different. If they are different, correct default PATHs are essential, so e.g. tab completion works. And with altered search path, it's even more important that users know to login correctly.

Quote:

Folks need to learn what's where.
No, they need to learn what's available and when and how to use it.

syg00 01-01-2005 09:13 PM

FWIW I'm with misc
I offered the full path to help with a particular problem - I don't believe it's warranted normally.
Remember that the post I responded to initially said
Quote:

I am logged in as root.
Not su'd, but logged in. I took that to mean there was a more general problem. Citing the full path was simpler than trying to determine what that more general problem was.

timelord726 01-01-2005 09:26 PM

Sorry if I caused any confusion...

Anyway, can anyone help with my newest problem?

syg00 01-01-2005 09:40 PM

Quote:

Originally posted by timelord726
Sorry if I caused any confusion...
Not to worry - it gave a few of us the opportunity to get some things aired ;-)
Quote:

Anyway, can anyone help with my newest problem?
Not I - I haven't touched FC, so can't offer anything material.

misc 01-01-2005 10:19 PM

Subscribe to fedora-list. Community support is better there: http://www.redhat.com/mailman/listinfo/fedora-list

The Fedora Community Portal also provides gateways to the lists: http://fcp.homelinux.org/


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