LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 07-16-2005, 10:28 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
LFS 6.1 - a question on SWAP partition


Hi folks,

I'm prepared to remove LFS 6.0 which is being built and to start building LFS 6.1. I'm now making preparation according to the "book read_on_line";
http://www.linuxfromscratch.org/lfs/view/stable/

# fdisk -l
Code:
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        2563    20482875   83  Linux
/dev/hda3            2564        2690     1020127+  82  Linux swap
/dev/hda4            2691        4865    17470687+   5  Extended
/dev/hda5            2691        3907     9775521   83  Linux
/dev/hda6            3908        4637     5863693+  83  Linux
/dev/hda7            4638        4865     1831378+  83  Linux
[root@localhost ~]# df T
Code:
[root@localhost ~]# df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/hda2     ext3    20161204   7380592  11756472  39% /
/dev/hda1     ext3      101086     11461     84406  12% /boot
none         tmpfs      127744         0    127744   0% /dev/shm
/dev/hda5     ext3     9621848   1937940   7195132  22% /home
/dev/hda6     ext3     5771468   1616784   3861500  30% /mnt/lfs (LFS 6.0 not yet removed)
/dev/hda7 is for LiveCD of LFS 6.1 to be built later

According to;
2.3. Creating a File System on the Partition
http://www.linuxfromscratch.org/lfs/...ilesystem.html

mkswap /dev/[yyy]

To my understanding if the SWAP of FC3 host (/dev/hda3) is to be shared with LFS 6.1, I don't need to create a new SWAP partition. How can I tell LFS 6.1 to share the SWAP partition of FC3 host?

TIA

B.R.
satimis
 
Old 07-17-2005, 04:11 AM   #2
Yoyo302
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 36

Rep: Reputation: 15
try :

swapon /dev/[yyy]

or :

/sbin/swapon /dev/[yyy]
 
Old 07-17-2005, 05:19 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi Yoyo302,

Tks for your advice.

Quote:
try :

swapon /dev/[yyy]

or :

/sbin/swapon /dev/[yyy]
My problem is no spare partition for additional SWAP. LFS 6.1 must share the existing SWAP with the FC3 Host.

B.R.
satimis
 
Old 07-17-2005, 05:40 AM   #4
Yoyo302
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 36

Rep: Reputation: 15
ok, and "swapon" just "turning on" some partition as swap,
by the way, i thing you should add line telling where swap is to /etc/fstab
 
Old 07-17-2005, 06:41 AM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi Yoyo302,

Quote:
ok, and "swapon" just "turning on" some partition as swap,
by the way, i thing you should add line telling where swap is to /etc/fstab
Here is $ cat /etc/fstab
Code:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hda5               /home                   ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
/dev/hda3               swap                    swap    defaults        0 0
/dev/hdd                /media/cdrom            auto    pamconsole,exec,noauto,fscontext=system_u:object_r:removable_t,managed 0 0
/dev/hdc                /media/cdrecorder       auto    pamconsole,exec,noauto,fscontext=system_u:object_r:removable_t,managed 0 0
/dev/fd0                /media/floppy           auto    pamconsole,exec,noauto,fscontext=system_u:object_r:removable_t,managed 0 0
What shall I add. TIA

B.R.
satimis
 
Old 07-17-2005, 07:20 AM   #6
Yoyo302
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 36

Rep: Reputation: 15
ok, you shouldn't add anythink to fstab (i thought u haven't done it yet), but :
Quote:
/dev/hda3 swap swap defaults 0 0
this bolded swap should be changed to "none".

if your fstab is set like that you can simply reboot system and swap will start automaticly on hda3.
 
Old 07-17-2005, 08:40 AM   #7
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi Yoyo302,

Quote:
.....
this bolded swap should be changed to "none".

if your fstab is set like that you can simply reboot system and swap will start automaticly on hda3.
It worked for me.

# df -T
Code:
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/hda2     ext3    20161204   7397300  11739764  39% /
/dev/hda1     ext3      101086     11461     84406  12% /boot
none         tmpfs      127744         0    127744   0% /dev/shm
/dev/hda5     ext3     9621848   1947552   7185520  22% /home
SWAP partition does show here.

# fdisk -l /dev/hda
Code:
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   83  Linux
/dev/hda2              14        2563    20482875   83  Linux
/dev/hda3            2564        2690     1020127+  82  Linux swap
/dev/hda4            2691        4865    17470687+   5  Extended
/dev/hda5            2691        3907     9775521   83  Linux
/dev/hda6            3908        4637     5863693+  83  Linux
/dev/hda7            4638        4865     1831378+  83  Linux
What is the difference between these 2 entries?

B.R.
satimis
 
Old 07-17-2005, 09:39 AM   #8
Yoyo302
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 36

Rep: Reputation: 15
the first one shows partitions mounted "for system", we can say that system does use them, and the second entery shows all partitions on hda disc.
 
Old 07-17-2005, 09:44 AM   #9
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi Yoyo302,

Sorry, I haven't not made it clear in my previous posting. What I referred to were the following 2 lines;

/dev/hda3 swap swap defaults 0 0
/dev/hda3 none swap defaults 0 0

What is the difference between them?

B.R.
satimis
 
Old 07-17-2005, 10:40 AM   #10
Yoyo302
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 36

Rep: Reputation: 15
hi

am, u see if u paste 1st to fstab system at boot will try to mount swap partition in "swap" dir(probably in / dir) and 1st of all "swap" doesn't exist and 2nd try to mount swap somewere and u will see...
second line "tells" system at boot that swap partition has no mount point and won't be mounted. insted of it "swapon /dev/hda3" will be executed.
 
Old 07-17-2005, 01:04 PM   #11
kjordan
Member
 
Registered: Jul 2004
Distribution: LFS, I felt the itch and scratched it
Posts: 227

Rep: Reputation: 31
Quote:
Originally posted by Yoyo302
hi

am, u see if u paste 1st to fstab system at boot will try to mount swap partition in "swap" dir(probably in / dir) and 1st of all "swap" doesn't exist and 2nd try to mount swap somewere and u will see...
second line "tells" system at boot that swap partition has no mount point and won't be mounted. insted of it "swapon /dev/hda3" will be executed.
Hmm, I have no problems with swap in the second column. I think if it sees swap there it treats it as swap.

df -T shows mounted partitions by the command mount. If you want to see if your swap partition is up, use
swapon -s
 
Old 07-17-2005, 06:41 PM   #12
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi kjordan,

Tks for your advice.
Quote:
If you want to see if your swap partition is up, use
swapon -s
# swapon -s
Code:
Filename                                Type            Size    Used    Priority
/dev/hda3                               partition       1020116 0       -1
What does "Priority -1" indicate.?

It came to my notice that 'swapon' only works on 'su -'. 'su' does not work.

B.R.
satimis
 
Old 07-18-2005, 08:08 AM   #13
kjordan
Member
 
Registered: Jul 2004
Distribution: LFS, I felt the itch and scratched it
Posts: 227

Rep: Reputation: 31
The priority indicates (if you had multiple swap partitions) the order in which they should be used. -1 would be the fastest (the one closest to the beginning of the hard drive, which is the fastest place on the hard drive to access) and the most used. Use positive numbers (i.e. 0, 1, 2, 3, 4, 5, 6...) for any others with lower priority and those will be the slower ones and less used. Although you shouldn't really have to worry about that.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Just after polishing my LFS 5.0 system... partition question ParticleHunter Linux From Scratch 11 05-03-2004 10:54 PM
Swap Partition Question snatale1 Debian 1 09-21-2003 10:10 PM
Swap partition question. Mr_Floppy4 Linux - General 4 10-14-2002 10:15 PM
Dumb question about the SWAP partition freezinbutt Linux - Newbie 8 04-09-2002 12:36 PM
Swap Partition Question Chijtska Linux - Newbie 13 02-20-2002 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

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