Jump to content

Swap Partitions


mdg
 Share

Recommended Posts

I have two swap partitions on my HD, which has 9.1 and 9.2 installed. 9.2 is the active distro. I want to delete one of the swap partitions, but I'm not sure which. I will be replacing 9.1 today with Debian, so deleting the swap partition belonging to 9.1 won't cause any problems.

 

 

hda looks like this:

 

hda1 /mnt windows

hda5 /mnt/91home

hda6 /mnt/91root

hda7 swap

hda8 /home (9.2)

hda9 / (9.2)

hda10 swap

 

How can I find out which swap is being used by my primary distro?

Link to comment
Share on other sites

Yes, fstab will tell you which swap.

[root@ml root]# cat /etc/fstab
/dev/hda6 / reiserfs notail 1 1
none /dev/pts devpts mode=0620 0 0
/dev/hda5 /mnt/2k vfat umask=0,codepage=850,iocharset=iso8859-1 0 0
#/dev/hda1 /mnt/98 vfat umask=0,codepage=850,iocharset=iso8859-1 0 0
none /mnt/cdrom supermount dev=/dev/hdc,fs=udf:iso9660,ro,--,iocharset=iso8859-1 0 0
none /mnt/cdrom2 supermount dev=/dev/scd0,fs=udf:iso9660,ro,--,iocharset=iso8859-1 0 0
none /mnt/floppy supermount dev=/dev/fd0,fs=ext2:vfat,--,umask=0,sync,codepage=850,iocharset=iso8859-1 0 0
/dev/hda9 /mnt/share reiserfs notail 1 2
none /proc proc defaults 0 0
/dev/hda8 /slack reiserfs notail 1 2
/dev/hda7 swap swap defaults 0 0
[root@ml root]#

see /dev/hda7 swap swap defaults 0 0?

 

There's no need to create another swap. You only need one. You can have 10 distros and 5 hd's with only one swap. The kernel will find it when probing your hd's at install and you'll only need to verify it has found one, and that it's location is correct.

 

you can also

[root@ml root]# cat /proc/swaps
Filename                        Type            Size    Used    Priority
/dev/ide/host0/bus0/target0/lun0/part7 partition        208804  0       -1
[root@ml root]#

to find out which swap is in use.......here, you see part7 (hda7).

 

If you want to change which swap is used and the swap is not being used, using my hda7(swap) as an example, you'd run

swapoff> then edit the swap location in fstab to, oh say, hda10 then>swapon.

 

If the swap is in use you can still do this but be warned....it may take a while and could lock the machine depending on how much it's being used and how much free ram you have. It's definately a good idea to at least go to init 3 (console) and best to go to init 1.

 

Location? If you highly depend on swap space then towards the fron of the drive IS best. If it's barely used, then IMO the end of the drive is best putting the data towards the front of the drive. I try to keep mine in the middle of the hd. :juggle: and I have 256MB RAM so my swap is barely used and is only 200MB.

 

I like the procinfo command/pkg

[root@ml root]# procinfo -a
Linux 2.4.22-19mdk (gb@hp6.mandrakesoft.com) (gcc 3.3.1 ) #1 Fri Oct 24 00:54:15 CEST 2003 1CPU [ml.(none)]

Memory:      Total        Used        Free      Shared     Buffers      Cached
Mem:        255776      242004       13772           0       19200      105192
Swap:       208804           0      208804

Bootup: Sat Nov 15 10:09:58 2003    Load average: 0.30 0.21 0.11 1/68 2383

user  :       0:02:32.49   7.1%  page in :   151564  disk 1:     8410r    4581w
nice  :       0:00:00.00   0.0%  page out:    37217
system:       0:00:28.29   1.3%  swap in :        1
idle  :       0:32:32.81  91.5%  swap out:        0
uptime:       0:35:33.59         context :   668058

irq  0:    213359 timer                 irq 14:     12810 ide0
irq  1:      4585 keyboard              irq 15:        14 ide1
irq  2:         0 cascade [4]           irq 16:    125613 nvidia
irq  6:         1                       irq 21:         0 usb-uhci, usb-uhci,
irq  7:         2                       irq 22:         0 VIA8233
irq  8:         1 rtc                   irq 23:      2366 eth0
irq 12:     30993 PS/2 Mouse

Kernel Command Line:
 root=/dev/hda6 devfs=mount idebus=133 hdd=ide-scsi acpi=ht splash=quiet vga=normal

Modules:
52 *agpgart        1724 *nvidia           8  lp              25 *parport_pc      34 *parport          2 *ipt_TOS          4 *ipt_REJECT
 4 *ipt_LOG          1 *ipt_state        1 *ipt_multiport    2  ipt_conntrack    2 *iptable_filter   3 *iptable_mangle  20  iptable_nat
26 *ip_conntrack    15 *ip_tables       31  snd-seq-oss      6  snd-seq-midi-e  42 *snd-seq         43  snd-pcm-oss     14 *snd-mixer-oss
15 *snd-via82xx     78  snd-pcm         18  snd-timer       45  snd-ac97-codec   5  snd-mpu401-uar  17  snd-rawmidi      6  snd-seq-device
 9  snd-page-alloc  40  snd              6  soundcore       15 *af_packet       15 *via-rhine        4  mii             82 *supermount
 3 *nls_iso8859-1    4 *nls_cp850       12 *vfat            37  fat             33  ide-cd          32  cdrom           11  ide-scsi
89  usb-storage    104 *scsi_mod        25  usb-uhci        73 *usbcore          9  rtc            193 *reiserfs

Character Devices:                      Block Devices:
 1 mem             128 ptm               1 ramdisk
 2 pty/m%d         129 ptm               3 ide0
 3 pty/s%d         130 ptm               9 md
 4 tts/%d          131 ptm              22 ide1
 5 cua/%d          136 pts/%d
 6 lp              137 pts/%d
 7 vcs             138 pts/%d
10 misc            139 pts/%d
14 sound           162 raw
29 fb              180 usb
116 alsa            195 nvidia

File Systems:
[rootfs]            [bdev]              [proc]              [sockfs]            [tmpfs]             [shm]               [pipefs]
ext2                [ramfs]             [devfs]             [nfs]               [devpts]            reiserfs            [usbdevfs]
[usbfs]             vfat                [supermount]

[root@ml root]#

Link to comment
Share on other sites

thanks roland! :D I have a feeling you knew most of this though. You answered the actually question. I just happen to have the time to go into detail for mdg or any future viewer interested in the topic is all....mod/member isn't the issue here. :D We don't base getting modship on knowledge, but rather a level head........which makes me wonder why I am one :lol:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...