LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   linux booting problem with non-initialized swap space (https://www.linuxquestions.org/questions/linux-general-1/linux-booting-problem-with-non-initialized-swap-space-89197/)

the_twister 09-04-2003 10:30 AM

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

Eqwatz 09-04-2003 12:11 PM

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


All times are GMT -5. The time now is 02:20 AM.