Jason Yu
asked on
How to expand SWAP partition on Linux server
I have a new built linux server into which I was going to add RAC cluster. When I was building the system, I didn't pay much attension to the SWAP partition. The partition is only 7887872 kb. Now I need increase it to 16876240 kb, how could I do it?
I checked the free space on the system, it looks like it has some unpartitioned space.
[root@poseidon sysconfig]# free -k
total used free shared buffers cached
Mem: 32490736 1619164 30871572 0 95828 624460
-/+ buffers/cache: 898876 31591860
Swap: 7887872 0 7887872
[root@elysium 11.2.0]# free -k
total used free shared buffers cached
Mem: 16025908 15711920 313988 0 493724 9041760
-/+ buffers/cache: 6176436 9849472
Swap: 16876240 3604092 13272148
-------------------------- ---------- ------
Free space:
[root@poseidon sysconfig]# fdisk -l
Disk /dev/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 55264 56245 7887883+ 82 Linux swap / Solaris
/dev/sda10 56246 56500 2048256 83 Linux
I checked the free space on the system, it looks like it has some unpartitioned space.
[root@poseidon sysconfig]# free -k
total used free shared buffers cached
Mem: 32490736 1619164 30871572 0 95828 624460
-/+ buffers/cache: 898876 31591860
Swap: 7887872 0 7887872
[root@elysium 11.2.0]# free -k
total used free shared buffers cached
Mem: 16025908 15711920 313988 0 493724 9041760
-/+ buffers/cache: 6176436 9849472
Swap: 16876240 3604092 13272148
--------------------------
Free space:
[root@poseidon sysconfig]# fdisk -l
Disk /dev/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 55264 56245 7887883+ 82 Linux swap / Solaris
/dev/sda10 56246 56500 2048256 83 Linux
ASKER
HI, ganjos, thank you for your update.
what partition should I use for the new swap, it looks like all existing partition are too small for the new swap. I need 16876240 kb for the new swap area.
On your command "# mkswap /dev/sda?“ what number should I use to replace "?" sign.
------------------
Besides, I notice I indeed have some unpartitioned area.
from this you know the ending cylinder reaches to 60636,
/dev/sda4 39916 60636 166441432+ 5 Extended
But the realistic ending cylinder is 56500. How big is the unpartitioned space? Could I expand the SWAP partition to include this unpartitioned space? I appreciate your help.
/dev/sda10 56246 56500 2048256 83 Linux
what partition should I use for the new swap, it looks like all existing partition are too small for the new swap. I need 16876240 kb for the new swap area.
On your command "# mkswap /dev/sda?“ what number should I use to replace "?" sign.
------------------
Besides, I notice I indeed have some unpartitioned area.
from this you know the ending cylinder reaches to 60636,
/dev/sda4 39916 60636 166441432+ 5 Extended
But the realistic ending cylinder is 56500. How big is the unpartitioned space? Could I expand the SWAP partition to include this unpartitioned space? I appreciate your help.
/dev/sda10 56246 56500 2048256 83 Linux
You have extended partition as follow:
/dev/sda4 39916 60636 166441432+ 5 Extended
So you should be able to use from 56501 to 60636 as swap, you could add it as /dev/sda11?
/dev/sda4 39916 60636 166441432+ 5 Extended
So you should be able to use from 56501 to 60636 as swap, you could add it as /dev/sda11?
ASKER
I think I can add it as /dev/sda11, what command should I run to extend that partition?
Fdisk?
thank you.
Fdisk?
thank you.
ASKER
Any help for this?
I want to know if I can delete the existing SWAP partition and merge the space released from this partition with the unused space, then make a brand new bigger SWAP partition. which command should I use?
I want to know if I can delete the existing SWAP partition and merge the space released from this partition with the unused space, then make a brand new bigger SWAP partition. which command should I use?
You can't join sda9 with sda11, because there is sda10, unless sda10 can be deleted.
To delete sda9, disable current swap
# swapoff /dev/sda9
# fdisk /dev/sda9
and delete this partition, then
# fdisk /dev/sda10
if can delete sda10
# fdisk /dev/sda
type "n" for new to create a new partiton, it will be sda9
Make new swap
# mkswap /dev/sda9
Enable new swap
# swapon /dev/sda9
and edit swap entry in /etc/fstab
To delete sda9, disable current swap
# swapoff /dev/sda9
# fdisk /dev/sda9
and delete this partition, then
# fdisk /dev/sda10
if can delete sda10
# fdisk /dev/sda
type "n" for new to create a new partiton, it will be sda9
Make new swap
# mkswap /dev/sda9
Enable new swap
# swapon /dev/sda9
and edit swap entry in /etc/fstab
ASKER
Hi, ganjos, thank you for your detail reply.
I am not sure if it's safe to delete sda10. How could I know /dev/sd10 is used or not?
I am not sure if it's safe to delete sda10. How could I know /dev/sd10 is used or not?
ASKER
I indeed found some files on this partition. When I tried to list the parition for the ntpd file under path /etc/sysconfig, it shows the file locates on /dev/sda10 partition. In this case, I don't think I can delete this partition because the OS may not be working after this action. Please advise.
[root@poseidon sysconfig]# df -P ntpd | tail -1 | cut -d' ' -f 1
/dev/sda10
[root@poseidon sysconfig]# pwd
/etc/sysconfig
[root@poseidon sysconfig]#
[root@poseidon sysconfig]# df -P ntpd | tail -1 | cut -d' ' -f 1
/dev/sda10
[root@poseidon sysconfig]# pwd
/etc/sysconfig
[root@poseidon sysconfig]#
You can try to mount it, ie
# mount /dev/sda10 /mnt
# cd /mnt
# ls
Also if it was in /etc/fstab
# cat /etc/fstab
# mount /dev/sda10 /mnt
# cd /mnt
# ls
Also if it was in /etc/fstab
# cat /etc/fstab
ASKER
My goodness, are all these folders under /dev/sda10 partition?
[root@poseidon sysconfig]# mkdir /tmp/mnt
[root@poseidon sysconfig]# mount /dev/sda10 /mnt
[root@poseidon sysconfig]# cd /mnt
[root@poseidon mnt]# ls -alt
total 244
drwxr-xr-x 100 root root 12288 Jun 6 14:41 etc
drwxr-xr-x 28 root root 4096 Jun 4 16:32 .
drwxr-xr-x 28 root root 4096 Jun 4 16:32 ..
dr-xr-xr-x 2 root root 4096 Jun 4 16:32 net
drwxr-xr-x 2 root root 4096 Jun 4 16:32 media
-rw-r--r-- 1 root root 0 Jun 4 16:31 .autofsck
drwxr-xr-x 2 root root 12288 Jun 4 10:24 sbin
drwxr-x--- 15 root root 4096 May 31 15:09 root
drwxr-xr-x 11 root root 4096 May 10 11:14 lib
drwxr-xr-x 2 root root 4096 May 10 11:13 bin
drwxr-xr-x 9 root root 4096 May 10 11:13 lib64
drwxr-xr-x 8 root root 4096 Feb 27 14:41 home
drwxr-xr-x 3 root root 4096 Feb 12 16:49 opt
-rw-r--r-- 1 root root 0 Feb 9 01:31 .autorelabel
drwxr-xr-x 3 root root 4096 Feb 8 16:05 tftpboot
drwxr-xr-x 2 root root 4096 Feb 8 15:59 selinux
drwxr-xr-x 2 root root 4096 Feb 8 15:59 dev
drwxr-xr-x 2 root root 4096 Feb 8 15:58 boot
drwxr-xr-x 2 root root 4096 Feb 8 15:58 proc
drwxr-xr-x 2 root root 4096 Feb 8 15:58 sys
drwxr-xr-x 2 root root 4096 Feb 8 15:58 tmp
drwxr-xr-x 2 root root 4096 Feb 8 15:58 u1
drwxr-xr-x 2 root root 4096 Feb 8 15:58 u2
drwxr-xr-x 2 root root 4096 Feb 8 15:58 u3
drwxr-xr-x 2 root root 4096 Feb 8 15:58 usr
drwxr-xr-x 2 root root 4096 Feb 8 15:58 var
drwx------ 2 root root 16384 Feb 8 15:56 lost+found
drwxr-xr-x 2 root root 4096 Nov 8 2010 misc
drwxr-xr-x 2 root root 4096 Feb 16 2010 mnt
drwxr-xr-x 2 root root 4096 Feb 16 2010 srv
[root@poseidon mnt]#
[root@poseidon sysconfig]# mkdir /tmp/mnt
[root@poseidon sysconfig]# mount /dev/sda10 /mnt
[root@poseidon sysconfig]# cd /mnt
[root@poseidon mnt]# ls -alt
total 244
drwxr-xr-x 100 root root 12288 Jun 6 14:41 etc
drwxr-xr-x 28 root root 4096 Jun 4 16:32 .
drwxr-xr-x 28 root root 4096 Jun 4 16:32 ..
dr-xr-xr-x 2 root root 4096 Jun 4 16:32 net
drwxr-xr-x 2 root root 4096 Jun 4 16:32 media
-rw-r--r-- 1 root root 0 Jun 4 16:31 .autofsck
drwxr-xr-x 2 root root 12288 Jun 4 10:24 sbin
drwxr-x--- 15 root root 4096 May 31 15:09 root
drwxr-xr-x 11 root root 4096 May 10 11:14 lib
drwxr-xr-x 2 root root 4096 May 10 11:13 bin
drwxr-xr-x 9 root root 4096 May 10 11:13 lib64
drwxr-xr-x 8 root root 4096 Feb 27 14:41 home
drwxr-xr-x 3 root root 4096 Feb 12 16:49 opt
-rw-r--r-- 1 root root 0 Feb 9 01:31 .autorelabel
drwxr-xr-x 3 root root 4096 Feb 8 16:05 tftpboot
drwxr-xr-x 2 root root 4096 Feb 8 15:59 selinux
drwxr-xr-x 2 root root 4096 Feb 8 15:59 dev
drwxr-xr-x 2 root root 4096 Feb 8 15:58 boot
drwxr-xr-x 2 root root 4096 Feb 8 15:58 proc
drwxr-xr-x 2 root root 4096 Feb 8 15:58 sys
drwxr-xr-x 2 root root 4096 Feb 8 15:58 tmp
drwxr-xr-x 2 root root 4096 Feb 8 15:58 u1
drwxr-xr-x 2 root root 4096 Feb 8 15:58 u2
drwxr-xr-x 2 root root 4096 Feb 8 15:58 u3
drwxr-xr-x 2 root root 4096 Feb 8 15:58 usr
drwxr-xr-x 2 root root 4096 Feb 8 15:58 var
drwx------ 2 root root 16384 Feb 8 15:56 lost+found
drwxr-xr-x 2 root root 4096 Nov 8 2010 misc
drwxr-xr-x 2 root root 4096 Feb 16 2010 mnt
drwxr-xr-x 2 root root 4096 Feb 16 2010 srv
[root@poseidon mnt]#
ASKER
what I should do now? What the Oracle Cluster requires is the new node should have the same size of SWAP as the existing node. Since I didn't pay too much attention at first when I was installing the OS. Now, it looks hard to change. Could I make a new partition with the unused space and make the second SWAP partition, then make another new SWAP partition?
thanks.
thanks.
The safe way is forget about sda9, just make a new swap on sda11?
ASKER
Here is the reply from oracle support.
Hi Jason
You will need to action following on new node:
1. Is this the new home location: "/u1/oracle/11.2.0/gridhom e"
2. Set the swap to required settings as per Installation guide
3. Start ntp with -x option
4. Fix parameter rmem_default to same as on existing nodes:
Compatibility check: Kernel param "rmem_default" [reference node: elysium]
Node Name Status Ref. node status Comment
------------ ------------------------ ------------------------ ----------
poseidon 262144 4194304 mismatched
Kernel param "rmem_default" check failed
Thanks
Anouska
GCS
Hi Jason
You will need to action following on new node:
1. Is this the new home location: "/u1/oracle/11.2.0/gridhom
2. Set the swap to required settings as per Installation guide
3. Start ntp with -x option
4. Fix parameter rmem_default to same as on existing nodes:
Compatibility check: Kernel param "rmem_default" [reference node: elysium]
Node Name Status Ref. node status Comment
------------ ------------------------ ------------------------ ----------
poseidon 262144 4194304 mismatched
Kernel param "rmem_default" check failed
Thanks
Anouska
GCS
Sorry I can't help you with what oracle support already told you, but I think I have answered your question "How to expand SWAP partition on Linux server".
Basicly what I can see that you still have 4 times of the current swap space free for what ever you want to use including new swap.
Basicly what I can see that you still have 4 times of the current swap space free for what ever you want to use including new swap.
ASKER
thank you, ganjos.
Could I make another new SWAP partition which made me have two SWAP partition totally?
Please advise. I really want to learn how I could make this feasible.
thanks.
Could I make another new SWAP partition which made me have two SWAP partition totally?
Please advise. I really want to learn how I could make this feasible.
thanks.
ASKER
accordging to this post, can I use GParted Live CD to resize the /swap partition ?
/dev/sda9 55264 56245 7887883+ 82 Linux swap / Solaris
http://www.linuxforums.org/forum/red-hat-fedora-linux/104785-changing-partition-size-after-installation.html
/dev/sda9 55264 56245 7887883+ 82 Linux swap / Solaris
http://www.linuxforums.org/forum/red-hat-fedora-linux/104785-changing-partition-size-after-installation.html
You could simply add anther swap, ie
Partition sda11 with
# fdisk /dev/sda
Make new swap
# mkswap /dev/sda11
Enable new swap
# swapon /dev/sda11
and edit swap entry in /etc/fstab
Partition sda11 with
# fdisk /dev/sda
Make new swap
# mkswap /dev/sda11
Enable new swap
# swapon /dev/sda11
and edit swap entry in /etc/fstab
ASKER
thanks, when I am doing the first step, it asks for beginning and ending cylinder number. what number should I use for the ending cylinder if I want to add 8988368 kb SWAP space.
The present SWAP area on this server is 7887872 kb, I need increase it to 16876240 kb, how could I do the calculation? I am a newbie in linux world, and really appreciate your help. Thank you very much.
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): l
0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 82 Linux swap / So c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx
5 Extended 41 PPC PReP Boot 85 Linux extended da Non-FS data
6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee EFI GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
Command (m for help): n
First cylinder (56501-60636, default 56501):
The present SWAP area on this server is 7887872 kb, I need increase it to 16876240 kb, how could I do the calculation? I am a newbie in linux world, and really appreciate your help. Thank you very much.
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): l
0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 82 Linux swap / So c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx
5 Extended 41 PPC PReP Boot 85 Linux extended da Non-FS data
6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee EFI GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
Command (m for help): n
First cylinder (56501-60636, default 56501):
82 Linux swap.
ASKER
I think 82 is the type of the partition, but what is the "Last Cylinder" I need input to make the size a specific size?
I want to create a new SWAP partition with t a specific size of 8988368kb, with the existing SWAP partition of 7887872kb which make the total of 16876240kb.
Command (m for help): n
First cylinder (56501-60636, default 56501):
Using default value 56501
Last cylinder or +size or +sizeM or +sizeK (56501-60636, default 60636):
I want to create a new SWAP partition with t a specific size of 8988368kb, with the existing SWAP partition of 7887872kb which make the total of 16876240kb.
Command (m for help): n
First cylinder (56501-60636, default 56501):
Using default value 56501
Last cylinder or +size or +sizeM or +sizeK (56501-60636, default 60636):
You can enter the size of 8988368K.
ASKER
It says "value out of range". Do I have enough unpartitioned space available?
Command (m for help): n
First cylinder (56501-60636, default 56501):
Using default value 56501
Last cylinder or +size or +sizeM or +sizeK (56501-60636, default 60636): 8988368K
Value out of range.
Last cylinder or +size or +sizeM or +sizeK (56501-60636, default 60636):
Command (m for help): n
First cylinder (56501-60636, default 56501):
Using default value 56501
Last cylinder or +size or +sizeM or +sizeK (56501-60636, default 60636): 8988368K
Value out of range.
Last cylinder or +size or +sizeM or +sizeK (56501-60636, default 60636):
You can enter "60636", see what size comes out. Always can delete it.
ASKER
I got it, but how to make it swap
Command (m for help): p
Disk /dev/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 55264 56245 7887883+ 82 Linux swap / Solaris
/dev/sda10 56246 56500 2048256 83 Linux
/dev/sda11 56501 57620 8996368+ 83 Linux
Command (m for help): p
Disk /dev/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 55264 56245 7887883+ 82 Linux swap / Solaris
/dev/sda10 56246 56500 2048256 83 Linux
/dev/sda11 56501 57620 8996368+ 83 Linux
ASKER
It shows the size is 8996368 intead of 8988368, why there is a difference?
/dev/sda11 56501 57620 8996368+ 83 Linux
/dev/sda11 56501 57620 8996368+ 83 Linux
Because 8996368 was the real size, and 8999368 was "I want to add 8988368 kb SWAP space".
ASKER
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@poseidon mnt]#
is this an error? can I move forward to the step 2?
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@poseidon mnt]#
is this an error? can I move forward to the step 2?
ASKER
Command (m for help): q
[root@poseidon mnt]# mkswap /dev/sda10
mkswap: error: /dev/sda10 is mounted; will not make swapspace.
[root@poseidon mnt]#
I deleted the old swap partition and want to make a brand new partition.
[root@poseidon mnt]# mkswap /dev/sda10
mkswap: error: /dev/sda10 is mounted; will not make swapspace.
[root@poseidon mnt]#
I deleted the old swap partition and want to make a brand new partition.
You said you delete sda9? what about sda10? You can't re-partition the space was used by sda9 and sda10 without reboot.
ASKER
I indeed reboot the system and got the following result.
[mis@poseidon ~]$ su -
Password:
[root@poseidon ~]# fdisk -l
Disk /dev/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 56246 56500 2048256 83 Linux
/dev/sda10 56501 58601 16876251 83 Linux
I want to make sda10 as the swap partition, but it doesn't show Linux swap / Solaris
here is the /etc/fstab file:
[root@poseidon ~]# vi /etc/fstab
LABEL=/ / ext3 defaults 1 1
/dev/VolGroup00/LogVol00 /u1 ext3 defaults 1 2
/dev/VolGroup01/LogVol01 /u2 ext3 defaults 1 2
/dev/VolGroup02/LogVol02 /u3 ext3 defaults 1 2
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
#LABEL=SWAP-sda9 swap swap defaults 0 0
/dev/sda10 swap swap defaults 0 0
~
[mis@poseidon ~]$ su -
Password:
[root@poseidon ~]# fdisk -l
Disk /dev/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 56246 56500 2048256 83 Linux
/dev/sda10 56501 58601 16876251 83 Linux
I want to make sda10 as the swap partition, but it doesn't show Linux swap / Solaris
here is the /etc/fstab file:
[root@poseidon ~]# vi /etc/fstab
LABEL=/ / ext3 defaults 1 1
/dev/VolGroup00/LogVol00 /u1 ext3 defaults 1 2
/dev/VolGroup01/LogVol01 /u2 ext3 defaults 1 2
/dev/VolGroup02/LogVol02 /u3 ext3 defaults 1 2
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
#LABEL=SWAP-sda9 swap swap defaults 0 0
/dev/sda10 swap swap defaults 0 0
~
ASKER
for the above /etc/fstab file, I commented out the old swap definition line and added a brand new line, I guess there is something wrong here.
what is interesting is when i use "free -k" command to show the swap area, it indeed changed to the value I want to.
[root@poseidon ~]# free -k
total used free shared buffers cached
Mem: 32490736 1168856 31321880 0 27800 276860
-/+ buffers/cache: 864196 31626540
Swap: 16876240 0 16876240
what is interesting is when i use "free -k" command to show the swap area, it indeed changed to the value I want to.
[root@poseidon ~]# free -k
total used free shared buffers cached
Mem: 32490736 1168856 31321880 0 27800 276860
-/+ buffers/cache: 864196 31626540
Swap: 16876240 0 16876240
Need to change ID of sda10 from 83 to 82, already memtioned earler.
ASKER
Which command to change it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It says "No partition is defined yet!". Please take a look at the output below.
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): t
No partition is defined yet!
Command (m for help): p
Disk /dev/sda10: 17.2 GB, 17281281024 bytes
255 heads, 63 sectors/track, 2100 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): p
Disk /dev/sda10: 17.2 GB, 17281281024 bytes
255 heads, 63 sectors/track, 2100 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help):
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): t
No partition is defined yet!
Command (m for help): p
Disk /dev/sda10: 17.2 GB, 17281281024 bytes
255 heads, 63 sectors/track, 2100 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): p
Disk /dev/sda10: 17.2 GB, 17281281024 bytes
255 heads, 63 sectors/track, 2100 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help):
ASKER
any update?
You haven't definded partition for /dev/sda10
Command (m for help): t
No partition is defined yet!
Command (m for help): t
No partition is defined yet!
ASKER
I think I already defined partition for sda10
:
[root@poseidon oracle]# fdisk -l
Disk /dev/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 56246 56500 2048256 83 Linux
/dev/sda10 56501 58601 16876251 83 Linux
Disk /dev/sdb: 429.4 GB, 429496729600 bytes
255 heads, 63 sectors/track, 52216 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 39163 314572768+ 83 Linux
Disk /dev/sdc: 80.5 GB, 80530636800 bytes
255 heads, 63 sectors/track, 9790 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 9791 78643168+ 83 Linux
Disk /dev/sde: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 10240 10485744 83 Linux
Disk /dev/sdd: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 10240 10485744 83 Linux
Disk /dev/sdf: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
.....
:
[root@poseidon oracle]# fdisk -l
Disk /dev/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 56246 56500 2048256 83 Linux
/dev/sda10 56501 58601 16876251 83 Linux
Disk /dev/sdb: 429.4 GB, 429496729600 bytes
255 heads, 63 sectors/track, 52216 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 39163 314572768+ 83 Linux
Disk /dev/sdc: 80.5 GB, 80530636800 bytes
255 heads, 63 sectors/track, 9790 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 9791 78643168+ 83 Linux
Disk /dev/sde: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 10240 10485744 83 Linux
Disk /dev/sdd: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 10240 10485744 83 Linux
Disk /dev/sdf: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
.....
I couldn't see it has been definded, if it was, the "p" command should show the partition start and end points, but you output showed nothing, see below.
Command (m for help): p
Disk /dev/sda10: 17.2 GB, 17281281024 bytes
255 heads, 63 sectors/track, 2100 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help):
Command (m for help): p
Disk /dev/sda10: 17.2 GB, 17281281024 bytes
255 heads, 63 sectors/track, 2100 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help):
ASKER
for some reason, it is showing up now.
[root@poseidon 11.2.0]# fdisk /dev/sda
The number of cylinders for this disk is set to 60636.
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/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 56246 56500 2048256 83 Linux
/dev/sda10 56501 58601 16876251 83 Linux
Command (m for help):
[root@poseidon 11.2.0]# fdisk /dev/sda
The number of cylinders for this disk is set to 60636.
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/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 56246 56500 2048256 83 Linux
/dev/sda10 56501 58601 16876251 83 Linux
Command (m for help):
ASKER
it works now this time.
Command (m for help): p
Disk /dev/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 56246 56500 2048256 83 Linux
/dev/sda10 56501 58601 16876251 82 Linux swap / Solaris
Command (m for help):
thank you very much.
Command (m for help): p
Disk /dev/sda: 498.7 GB, 498753077248 bytes
255 heads, 63 sectors/track, 60636 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 27549 221182920 8e Linux LVM
/dev/sda3 27550 39915 99329895 8e Linux LVM
/dev/sda4 39916 60636 166441432+ 5 Extended
/dev/sda5 39916 52281 99329863+ 8e Linux LVM
/dev/sda6 52282 53275 7984273+ 83 Linux
/dev/sda7 53276 54269 7984273+ 83 Linux
/dev/sda8 54270 55263 7984273+ 83 Linux
/dev/sda9 56246 56500 2048256 83 Linux
/dev/sda10 56501 58601 16876251 82 Linux swap / Solaris
Command (m for help):
thank you very much.
ASKER
Thank you very much, learnt a lot.
You are welcome.
# mkswap /dev/sda?
Disable current swap
# swapoff /dev/sda9
Enable new swap
# swapon /dev/sda?
and edit swap entry in /etc/fstab