Increase swap

Hi
I need to add to my swap space. I have to disks on the box with some unassigned label. What is the fastest way to merge one of them to swap space? for example part 5 on Seagate.

# df -k /tmp/.
Filesystem            kbytes    used   avail capacity  Mounted
/dev/dsk/c0t1d0s0    1442965  330686  967983    26%    /root5

# vmstat
 procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr aa dd dd f0   in   sy   cs us sy id
 0 0 0  80768 140072  0  26 31 24 54  0  5  0  1  4  0  328  220   72 15  2 83

# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0     384120   21643  324065     7%    /
/dev/dsk/c0t0d0s6    1531984  810387  660318    56%    /usr
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
/dev/dsk/c0t0d0s1     144274   13026  116821    11%    /var
/dev/dsk/c0t0d0s7      48237      10   43404     1%    /export/home
/dev/dsk/c0t0d0s5    1685464  737824  897077    46%    /opt
/dev/dsk/c0t1d0s0    1442965  330686  967983    26%    /root5
/dev/dsk/c0t1d0s1    2886434 2079701  518090    81%    /root5/usr
/dev/dsk/c0t1d0s3     480815       1  432733     1%    /root5/var
/dev/dsk/c0t1d0s2    2704610  977136 1457013    41%    /root5/opt
remote:/1           30237424 23247384 5454048    81%    /remote/1
remote:/2           30237456 12908368 15793104    45%    /remote/2
remote:/3           37437032 21590112 13945200    61%    /remote/3
remote1:/home/ultra    150141192 22306752 120207688    16%    /export/home/test

format> verify

Primary label contents:

Volume name = <        >
ascii name  = <Seagate Medalist 34342A cyl 8892 alt 2 hd 15 sec 63>
pcyl        = 8894
ncyl        = 8892
acyl        =    2
nhead       =   15
nsect       =   63
Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0 -  866      400.06MB    (867/0/0)   819315
  1        var    wm     867 - 1192      150.42MB    (326/0/0)   308070
  2     backup    wm       0 -  216      100.13MB    (217/0/0)   205065
  3       swap    wu    1193 - 1747      256.09MB    (555/0/0)   524475
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm    1748 - 5432        1.66GB    (3685/0/0) 3482325
  6        usr    wm    5433 - 8781        1.51GB    (3349/0/0) 3164805
  7       home    wm    8782 - 8890       50.30MB    (109/0/0)   103005

format> verify

Primary label contents:

Volume name = <        >
ascii name  = <IBM-DTTA-351010           cyl 16381 alt 2 hd 16 sec 63>
pcyl        = 16383
ncyl        = 16381
acyl        =    2
nhead       =   16
nsect       =   63
Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -  3047        1.47GB    (3048/0/0) 3072384
  1        usr    wm    3048 -  9143        2.93GB    (6096/0/0) 6144768
  2 unassigned    wm    9144 - 14855        2.75GB    (5712/0/0) 5757696
  3        var    wm   14856 - 15871      500.06MB    (1016/0/0) 1024128
  4 unassigned    wm   15872 - 16379      250.03MB    (508/0/0)   512064
  5 unassigned    wm       0                0         (0/0/0)          0
  6 unassigned    wm       0                0         (0/0/0)          0
  7 unassigned    wm       0                0         (0/0/0)          0
mehranalmasiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

omarfaridCommented:
in general, use

swap -a <slicename>

e.g.

swap -a /dev/dsk/c0t0d0s1

You need to add it to /etc/vfstab file as well
0
mehranalmasiAuthor Commented:
don't I have to make Seagate's
5 unassigned    wm    1748 - 5432        1.66GB    (3685/0/0) 3482325
available to the system before I can do the swap -a?
0
omarfaridCommented:
The only thing you need to do is:

1- use an unused slice
2- The slice start and size are set
3- The slice does not overlap with other used slices on the disk

The slice setting is done by format tool
0
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

mehranalmasiAuthor Commented:
how would I address the unused slice in Seagate's
5 unassigned    wm    1748 - 5432        1.66GB    (3685/0/0) 3482325

in the swap -a <slicename> ?
0
omarfaridCommented:
Sorry, are you asking "What is the device name for slice 5 of Seagate disk"?

What is the disk name when you run format command?

it should be something like c0t0d0
0
mehranalmasiAuthor Commented:
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c0t0d0 <Seagate Medalist 34342A cyl 8892 alt 2 hd 15 sec 63>
          /pci@1f,0/pci@1,1/ide@3/dad@0,0
       1. c0t1d0 <IBM-DTTA-351010 cyl 16381 alt 2 hd 16 sec 63>
          /pci@1f,0/pci@1,1/ide@3/dad@1,0

What I am not sure on is the <slicename> of the command you are recommending: swap -a <slicename>
0
omarfaridCommented:
From what you posted, seagate is c0t0d0 and slice 5 is c0t0d0s5

So your command will be:

swap -a /dev/dsk/c0t0d0s5
0
mehranalmasiAuthor Commented:
thanks. now my only concern in the df -k output (shown in original post)
/dev/dsk/c0t0d0s5    1685464  737824  897077    46%    /opt

isn't this slice already designated as /opt and in use?
0
omarfaridCommented:
Sorry, if slice 5 is already used for /opt, then do not run the command given since it will destroy /opt.

If you have space there that you want to use for swap, then you may create a file there then add it with swap -a

use mkfile to create the file. Here steps:

- see the file system that have space and have less IO to it
- cd /path/to/filesystem (this could be /opt or any other filesystem you think is having space and less IO)
- mkdir myspace
- cd myspace
- mkfile -n 200 m swap1
- swap -a /path/to/filesystem/myspace/swap1
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mehranalmasiAuthor Commented:
My only concern was that if I had followed your instructions without evaluating them, I would have been in deep doodoo.  A newbie might not prctice due diligence.
0
omarfaridCommented:
Sorry for that, and it was excellent that you double checked what I told :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.