Go Back   PCMech Forums > Linux Support > Linux OS and Software Assistance

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 11-04-2006, 09:41 AM   #1
Member (10 bit)
 
Join Date: Oct 2004
Location: Somewhere in Malaysia...
Posts: 953
Swap file required?

Oh, I just installed a Damn Small Linux (DSL) in one of my old comp, and it's even good for a 200MHz computer.

But should I make a Linux Swap-file partition in the cfdisk? How can I make the installed Linux in my HDD to use the Swap-file partition? I made one, but not sure whether the operating system itself utilises the Swap-file as well.

Or is it not required at all?
The_YongGrand is offline   Reply With Quote
Old 11-04-2006, 09:17 PM   #2
Member (5 bit)
 
Join Date: Aug 2003
Posts: 20
I forget how to use cfdisk.(though it's not hard) But you can do the same thing with fdisk (the one provided with a Linux distro NOT WINDOWS/MSDOS. There is a difference)

Type the following [CODE]'ed commands:

I believe on DSL, to become in console, you just type the following (if not, it shouldn't be hard to figure out; read their documentation)
Code:
# sudo su
Hard disk are shown in the /dev directory as either /dev/hda (and IDE drive), /dev/sda (a serial drive) or etc. And for each drive, it is the next letter in the english alphabet. So your first IDE drive is called /dev/hda, and your second IDE drive is called /dev/hdb. And for each partition on each seperate drive, the drive name is succeeded by a number. So if you have 3 partitions on /dev/hda, it would look like the following:

/dev/hda1
/dev/hda2
/dev/hda3

There is no difference in the naming scheme if you make one some filesystem or a swap partition.

So now type the following, but change the drive name to the one that you want to install a swap partition on. (note: if you want to resize a partition, you'll be better off using GParted that is either on an Ubuntu (6.06 or later), or GParted organizations own live cd. Both free.)

For the remainder of this tutorial, I'm going to use /dev/hda as the drive I want to edit, but change if necessary!

Code:
# fdisk /dev/hda
You should see the following:

Code:
geotop george # fdisk /dev/sda

The number of cylinders for this disk is set to 7113.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):
Typing `p' will show the partition (if any) on the selected drive:

Code:
geotop george # fdisk /dev/hda

The number of cylinders for this disk is set to 7113.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hda: 58.5 GB, 58506416640 bytes
255 heads, 63 sectors/track, 7113 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help):
This shows a blank drive. If you have other partitions, you would see them. No need to worry about them, unless it takes all the space up. In which case you need to resize your partition using the free software described above, or just use another drive.

NOTE: If you want to EXIT at ANY TIME WITHOUT SAVING CHANGES. Press and hold ctrl and while holding, pressing c... a couple times if necessary.

Assuming it is a blank drive, or have space, type `n' to go through the procedure to create a new partition:

Code:
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
Type `p', and type and enter the number the drive will be. You'll be asked the first sector of the drive it will start on. It defaults to the first free sector that is not currently being used by another partition, so pressing enter should be fine. Then the easiest way to create the size is type + followed by the number of megabytes that you want it to be. I've been told to make at least double what you have in RAM, but I usualy go no more then 512. You decide. After you type the number, type M, it'll look like this "+512M". Press enter when finished.:

Code:
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-7113, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-7113, default 7113): +512M

Command (m for help):
Press `p' again to see your current drive your editing to see what you changed:

Code:
Disk /dev/hda: 58.5 GB, 58506416640 bytes
255 heads, 63 sectors/track, 7113 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          63      506016   83  Linux

Command (m for help):
As you can see, there is a new partition with the size more or less 512 megabytes, but it is not ready to become a swap partition.

You need now to type `t' to change the type of a partition. If you had more then one partition, it would ask you to choose the partition number, but since there is only one in this example, it defaults to the only one.

When asked for the `Hex code' type 82 for Linux Swap. Enter `p' once again and you shall see (maybe more or less) the following:

Code:
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 82
Changed system type of partition 1 to 82 (Linux swap / Solaris)

Command (m for help): p

Disk /dev/hda: 58.5 GB, 58506416640 bytes
255 heads, 63 sectors/track, 7113 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1          63      506016   82  Linux swap / Solaris

Command (m for help):
If your confident this is what you want, type `w' and press enter to save the partition table to disk. Give it a moment. Writing to and from the disk is slow as a mother, depending on what your doing. (this isn't too slow, but not always the case)

You should be back at the command line. Now you need to make the swap partition into an actual swap partition that can be used.

Type the following for the drive AND the partion number of that drive that is going to be used as swap:

Code:
mkswap /dev/hda1
You maybe asked to allow the creation of the swap partition, for it'll erase everything within that partition.

You now have a working swap partition.

DSL has it's own way to install DSL... I haven't used DSL since 0.6.1 so it's been a while and it sorta left my mind. It's like `hdinstall', but really, read the doc found on DSL's web site and you should be fine.

If you need to have your swap partition activated at some time with any distro, type the following:

Code:
swapon /dev/hda1
And if you want to edit what partition to be activated at start up on most(if not all) Linux distros, you'll have to edit the file fstab found in /etc.

Hope this helps.
ChaosLord40k is offline   Reply With Quote
Old 11-05-2006, 04:07 AM   #3
Member (10 bit)
 
Join Date: Oct 2004
Location: Somewhere in Malaysia...
Posts: 953
Thanks, I did that in the DSL and finally got it working fine with the swap thingy.
The_YongGrand is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Computer Acronyms Floppyman Computer Hardware 156 06-18-2006 06:25 AM
External Dvd Burner Not Working PreDeadMan Computer Hardware 1 09-17-2005 03:48 PM
Swap file size? AzCoastie Windows Legacy Support (XP and earlier) 8 01-18-2003 07:32 PM
Partitioning with Unattended Installation (XP Pro) catch23 Windows Legacy Support (XP and earlier) 6 10-01-2002 12:16 AM
swap file... TazZ_Nc Windows Legacy Support (XP and earlier) 5 09-20-2002 03:09 PM


All times are GMT -5. The time now is 05:55 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2