LinuxQuestions.org
Visit Jeremy's Blog.
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-04-2003, 10:30 AM   #1
the_twister
LQ Newbie
 
Registered: Aug 2003
Location: Hyderabad , India
Posts: 5

Rep: Reputation: 0
linux booting problem with non-initialized swap space


I have win-xp n RH-9 on my system with 256 mb ram.At the time of installation i kept 256 mb of swap space n changed it to 512 using partition magic and while rebooting the system crashed
 
Old 09-04-2003, 12:11 PM   #2
Eqwatz
Member
 
Registered: May 2003
Distribution: Slack Puppy Debian DSL--at the moment.
Posts: 341

Rep: Reputation: 30
Change it back and pray. Pray hard.

If it boots: sing, dance, etc.

If it doesn't, you are going to have to boot up a rescue CD. First identify your swap partition. Then you use the mkswap command for the correct partition. If the location is the same and all, it very well may boot. If that doesn't work,you may get it to boot if you edit the init scripts for "S" single user. It also may be init 2 or 3. The main thing is that you can run a minimal linux in a 256MB environment with no swap at all. You want to boot up to a command line (no X) without any non-essential services. (Look up the files on Red Hat--see below as to why.) So you have to edit everything accordingly.

.(AAAARRRRGGGHHH!!!! Norton Antivirus Killed lilo on my linux box. And I didn't make a boot-disk! *(^&%*^$$$%%#$#$! Now I have to use Rescue. All I have to do is mount the linux filesystems and write a full path to lilo on the hard drive. Not too bad. But I shouldn't have run NAV when I was half-asleep.)

For your information the next section taken from the Red Hat site--Ignore the "parted" section:
To add a swap partition (assuming /dev/hdb2 is the swap partition you want to add):


The hard drive can not be in use (partitions can not be mounted, and swap space can not be enabled). The easiest way to achieve this it to boot your system in rescue mode. Refer to Chapter 8 for instructions on booting into rescue mode. When prompted to mount the filesystem, select Skip.

Alternately, if the drive does not contain any partitions in use, you can unmount them and turn off all the swap space on the hard drive with the swapoff command.

Create the swap partition using parted or fdisk. Using parted is easier than fdisk; thus, only parted will be explained. To create a swap partition with parted:


At a shell prompt as root, type the command parted /dev/hdb, where /dev/hdb is the device name for the hard drive with free space.

At the (parted) prompt, type print to view the existing partitions and the amount of free space. The start and end values are in megabytes. Determine how much free space is on the hard drive and how much you want to allocate for a new swap partition.

At the (parted) prompt, type mkpartfs part-type linux-swap start end, where part-type is one of primary, extended, or logical, start is the starting point of the partition, and end is the end point of the partition.


Warning
Changes take place immediately; be careful when you type.


Exit parted by typing quit.

Now that you have the swap partition, use the command mkswap to setup the swap partition. At a shell prompt as root, type the following:

mkswap /dev/hdb2


To enable the swap partition immediately, type the following command:

swapon /dev/hdb2


To enable it at boot time, edit /etc/fstab to include:

/dev/hdb2 swap swap defaults 0 0


The next time the system boots, it will enable the new swap partition.

After adding the new swap partition and enabling it, make sure it is enabled by viewing the output of the command cat /proc/swaps or free
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can I use linux swap space with BSD? thedeadhead *BSD 1 08-30-2005 11:52 AM
Sony Vaio PCG-NVR23 Booting FC2, hangs after "Enabling Swap Space" mgargiullo Fedora 1 09-08-2004 09:47 AM
Linux swap space in FreeBSD rch *BSD 5 02-28-2004 11:57 AM
swap-space fstab problem MarkGraham Linux - Newbie 3 12-06-2002 11:23 AM
swap-space fstab problem MarkGraham Linux - Newbie 0 12-05-2002 07:06 PM

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

All times are GMT -5. The time now is 05:49 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