- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- how i create swap partition
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2009 03:44 AM
тАО04-09-2009 03:44 AM
how i create swap partition
can you tell how i can create/add swap partition
for RedHat Linux for OS already install.
i need step to create
regards
hany
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2009 04:15 AM
тАО04-09-2009 04:15 AM
Re: how i create swap partition
I'd suggest trying to make the space as far back in the drive as possible as things like grub may be referencing a /boot partition quite far back too, depending on where you personally placed it. IF you can shrink the end one and tg it at teh very back, even better.
This shouldn't be too much of a problem though as FC4 loves using ext2 fs labels in /etc/fstab meaning rahter than referencing a partition by it's location, it looks on all partitions on all devices for a certain name. meaning if it's partition id changes (e.g. hda6 becomes hda7) then it probably won't care anyway.
So once you have free space, create a partition with fdisk then format it with "mkswap /dev/hda{b]X[/b]" then just use "swapon" to load it. if it loads fine, stick an entry in /ets/fstab to permanntly mount it on boot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2009 04:55 AM
тАО04-09-2009 04:55 AM
Re: how i create swap partition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-09-2009 07:17 PM
тАО04-09-2009 07:17 PM
Re: how i create swap partition
The command to do the thing is "mkswap"
you can create a swap partition on a block device(/dev/sdax) or even on a file and no need of reboot or down time is required.
if you are to use a swap file insted of raw partition use "dd" to create a file before use "mkswap" on that file
eg:
dd if=/dev/zero of=/"path & name swap file" \
bs=1024 count="how many of 1024s to file"
once this is done you can use "mkswap" on the file you crated
Most important thing is after crating a swap device or file to tell the OS to use that file or device you have to run
"swapon -a"
please read the man page for mkswap for more info
Good Luck..!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-10-2009 06:57 AM
тАО04-10-2009 06:57 AM
Re: how i create swap partition
This scenario is only applicable when LVM is supported
├в ┬в Create an LV on the appropriate VG
#lvcreate -L 5000 /dev/vg00
├в ┬в Enable the swap on the LV created
#mkswap /dev/vg00/lvol12
├в ┬в Activate the swap on the LV
#swapon /dev/vg00/lvol10
├в ┬в Update the fstab
If vg00 is comprised of only 1 disk (or 2 if you are mirrored) then spreading multiple swap areas out over the same disk is dumb. Consider that you have 4 swap volumes on the same disk at equal priority to spread the i/o evenly. As the paging activity spreads the swap across these 4 lvols, the heads will be moving like crazy because all of this is occurring on the same physical disk. If you do have multiple swap areas on the same disk then you want to assign them different priorities so that one will be completely used before the next one is used at all. Only in the case where swap is spread over multiple physical disks would you set the priorities the same.
So that is why priorities are kept different.
#swapon -s
Filename Type Size Used Priority
/dev/vg00/lvol8 (deleted) partition 2097144 2095220 -1
/dev/vg00/lvol9 (deleted) partition 2097144 1157016 -2
/dev/vg00/lvol2 (deleted) partition 2097144 0 -3
/dev/vg00/lvol12 (deleted) partition 5119992 0 -4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2009 12:27 AM
тАО04-11-2009 12:27 AM
Re: how i create swap partition
For swap area give at least twice computer memory size, ex. +512M.
The steps are as follows,
Default partition type is LINUX native, to change a Linux partition to a swap partition with fdisk:
l # show partition
t 1 # change partition type for partition 1
Hex code: 82 # set type to Linux swap
w # write partition table
The new swap partion is set using the below listed commands to create and enable the swap partition.
# mkswap -c /dev/hda2 size_in_blocks
# swapon /dev/hda
To enable all swap partitions:
# swapon -a
Check swap space usage with /usr/bin/top, /usr/bin/free and defined partitions with /sbin/swapon (see Section 10.4) as follows:
$ /sbin/swapon -s
Filename Type Size Used Priority
/dev/hda5 partition 2048248 0 -1
/dev/hda6 partition 2048248 0 -2
Finally add the new swap partition to /etc/fstab:
/dev/hda14 / ext2 defaults 1 1
/dev/hda1 /boot ext2 defaults 1 2
/dev/hda13 /home ext2 defaults 1 2
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
/dev/hda5 swap swap defaults 0 0
/dev/hda6 swap swap defaults 0 0
/dev/fd0 /mnt/floppy ext2 noauto,owner 0 0
none /proc proc defaults 0 0
none /dev/pts devpts gid=5,mode=620 0 0
#
nodea:/fsa /fsa nfs rw,soft,bg 0 0
nodea:/fsb /fsb nfs ro,soft,bg 0 0
N.B. With RH7.x file systems in /etc/fstab are listed by label instead of using partition number, in the above example /etc/fstab entry /dev/hda1 for the /boot file system, is mapped to LABEL=/boot for RH7.x.
https://help.ubuntu.com/community/SwapFaq#head-75ffcb00cefe143fc380f84d7ea9203f16a596d0
RGds//
Taifur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-13-2009 02:43 AM
тАО04-13-2009 02:43 AM
Re: how i create swap partition
http://www.vglug.info/swap-partition-and-swap-file-rhel-4
http://forums11.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=1046206
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com