[SUMMARY] Making more swap space

From: Francesco Zerra <zerra_at_cmns.mnegri.it>
Date: Tue, 05 May 1998 11:37:33 +0200 (MET DST)

Many thanks to all who answered so fast!
Specially to Dr. Tom Blinn and Lombardi Emanuele (who answered me in Italian).
On my system I've act up to the following steps:

        1) bring the system into single-user mode and mount filesystems
                # shutdown -h now
>>> boot -flag S
                # bcheckrc

        2) make a backup of the filesystem
                # cd /utenti
                # vdump -0 -f /dev/rmt0h .

        3) edit the disklabel after zeroing it
                # disklabel -z rz1
                # disklabel -rw rz1 rz29
                # disklabel -e rz1
this is my new label (partition c is for data...h for swap space)
# size offset fstype [fsize bsize cpg]
  a: 131072 0 unused 1024 8192 # (Cyl. 0 - 57*)
  b: 401408 131072 unused 1024 8192 # (Cyl. 57*- 235*)
  c: 7855760 0 ADVfs # (Cyl. 0 - 3475)
  d: 2623488 532480 unused 1024 8192 # (Cyl. 235*- 1396*)
  e: 2623488 3155968 unused 1024 8192 # (Cyl. 1396*- 2557*)
  f: 2600624 5779456 unused 1024 8192 # (Cyl. 2557*- 3707*)
  g: 3936256 532480 unused 1024 8192 # (Cyl. 235*- 1977*)
  h: 524320 7855760 unused 1024 8192 # (Cyl. 3476 - 3707)

        4) then create ufs or (in my case) domain and fileset
                # newfs /dev/rz1c
                ( # mkfdmn /dev/rz1c utenti ; mkfdmn utenti utenti)

        5) mount your new filesystem and restore your data
                # mount -w -t ufs /dev/rz1c /utenti
                ( mount -t advfs utenti#utenti /utenti )

        6) restore your data
                # cd /utenti
                # vrestore -x -f /dev/rmt0h .

        7) add the following line in /etc/fstab
           (they could be changed as you want...refer to fstab(4))
                /dev/rz1c /utenti ufs rw 0 1
                (utenti#utenti /utenti advfs rq,userquota 1 1)

        8) bring the system to multi-user mode
                # init 3

That's all!


==============================================================================
Stefan Albert <Albert_at_staedtler.de>

if you use the default partitioning of your disk, then you already use the whole space of it. The partition c is the full size of the disk.
You must use another partition for your ufs (on this disk - with fewer space !) and then you can use another partition for swap.
You can see your actual partitioning with the command disklabel.

        disklabel /dev/rrz4c

With this command you can also change the partition sizes - see the man pages...
Hope this helps a bit,
Stefan

===============================================================================
Arrigo Triulzi <arrigo_at_albourne.com>

You need to re-partition the disk, see the disklabel man page for
doing that. It is advisable to do

EDITOR=vi; export EDITOR

before starting disklabel, otherwise you are stuck with ed for editing
the partition table.

If you don't have enough space free on the disk then you will have to
reduce the size of other partitions - you can only do this if you have
backed them up of course.

Arrigo

-- 
Arrigo Triulzi <arrigo_at_albourne.com>
Albourne Partners Ltd. - London, UK
===============================================================================
Lombardi Emanuele <lele_at_mantegna.casaccia.enea.it> 
answered me in Italian...I'm sorry for esclusion in this summary
===============================================================================
Randy Rodgers <rrodgers_at_ci.ft-wayne.in.us>
Add an entry in /etc/fstab for the swap partition such as:
/dev/rz4c    swap2    ufs    sw    0    0
assuming you will be using the whole disk for swap space.  This is used to
mount the swap space when the system is booted.
Then execute the following to allocate the swap space on the fly:
swapon /dev/rz4c
This is described in the man page for swapon.
Randy Rodgers
===============================================================================
Robert Otterson <Robert.Otterson_at_digital.com>
   a quick way to add a swap is 
      #swapon  /dev/rz4c
   Then go back and make sure it makes it into your /etc/fstab file.
   Bob Otterson 
===============================================================================
"Alan Rollow - Dr. File System's Home for Wayward Inodes." <alan_at_nabeth.cxo.dec.com>
Backup the data on the file system, repartition the disk to get
the size partition you want for page/swap, recreate the UFS on
the remaining space (assuming you go with two partitions) and
restore.
===============================================================================
"Dr. Tom Blinn, 603-884-0646" <tpb_at_zk3.dec.com>
If your "rz4c" partition is the size of the whole disk, you have to back up
the file system there and recreate it.  I would recommend that you do this:
1)  Use dump to back up the file system on rz4c to an appropriate backup
medium, either a file on another disk (if you have a disk with enough free
space to hold it, this is the quickest approach) or to tape media.
2)  Relabel the rz4 disk using disklabel.  Zero the label, write a new
default label, then edit the default label to set up your partitions.  By
convention, the "b" partition is often used for swap, but you can use any
of the partitions you like.  The "a" and "c" partitions should always be at
the beginning of the disk.  If you want to share the disk between swap and a
file system, you might make the "a" partition begin at sector 0 and size it
as needed, then have the "b" partition follow it and use the rest of the 
disk.
3)  But a new file system in the partition you've chosen for data on the
rz4 disk, if it's "a", then "newfs /dev/rrz4a", then mount the file system
on an appropriate mount point and restore the old "rz4c" file system into
it.  Be sure to update your /etc/fstab file to make the new partition be
what is mounted at system startup.
4)  Use the swapon command to start swapping on the new swap partition; if
it's rz4b, then "swapon /dev/rz4b", and be sure to add a line in /etc/fstab
to have this partition used for swap in the future.  See the swapon man page
for examples.
Now you're up and running, bring the system back up to multi-user mode if 
you shut it down to do this work.  You don't really NEED to shut it down
as long as you don't have any users trying to access the file system on the
rz4 disk while you're doing the reorganization.
Tom
 
=============================================================================
Thanks to all,
   Francesco
Received on Tue May 05 1998 - 11:36:56 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT