Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: jlf@ryhope.alf.dec.com (Jeff Finkelstein)
Subject: Re: swapdefault: How to hose a filesystem
Date: 7 Oct 1993 20:57:37 GMT	[thread overview]
Message-ID: <291vs1$ock@netnews.alf.dec.com> (raw)
In-Reply-To: CEJF1x.JJ5@atria.com


This is a warning to people who are considering changing the SCSI
address of your root device. Even though you do not need to rebuild
the kernel when you change disk addresses, you do need to change the
symlink for /sbin/swapdefault.

For example, on a given system the /sbin/swapdefault is a symbolic
link to /dev/rz3b. If you change your disk address to SCSI 0, the
symlink still points to /dev/rz3b. Now, lets say you add your second
disk and by chance install it at SCSI address 3. You decide to use the
'c' partition to get the whole disk.  Now you newfs it, and mount it
to /mnt so you can copy data to it. After spending hours working on it
you now decide to reboot and have it mount under the new mount point.

What will happen is the following:

1. During system initialization, the boot process looks for the file
/sbin/swapdefault. If the file exists, the symlink is followed to the
device partition and it is mapped as the initial swap space. If it
does not exist, the lazy swap mechanism is installed. Since the
/sbin/swapdefault is pointing to the /dev/rz3b device, it is installed
as the default paging space.

2. When the bcheckrc script is run, it fsck's and mounts the user
partitions that are specified in /etc/fstab. In this case, the
/dev/rz3c partition is mounted as /mnt.

3. When the S05paging script is run in rc2.d, it does a '/sbin/swapon -a',
which connects the vm system to the paging devices listed in
/etc/fstab.

Now, if you do a /etc/swapon -s you will see the following:

[ryhope] /sbin/swapon -s
Total swap allocation:
    Allocated space:        32768 pages (256MB)
    Reserved space:          6373 pages ( 19%)
    Available space:        26395 pages ( 80%)

Swap partition /dev/rz3b:
    Allocated space:        16384 pages (128MB)
    In-use space:            1808 pages ( 11%)
    Free space:             14576 pages ( 88%)

Swap partition /dev/rz0b:
    Allocated space:        16384 pages (128MB)
    In-use space:            1812 pages ( 11%)
    Free space:             14572 pages ( 88%)

And a 'df -t ufs' shows something like the following:

[ryhope]  df -t ufs
Filesystem     512-blks        used       avail capacity  Mounted on
/dev/rz0a        100764       64854       25832    72%    /
/dev/rz0g       1629224      727784      738516    50%    /usr
/dev/rz3c      11629224      240062     1226238     2%    /home

At this point the /dev/rz3b is being used as a swap device. When you look at
the partition table for /dev/rz3a you see the following:

8 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:   104542        0    unused     1024  8192         # (Cyl.    0 - 131*)
  b:   262144   104542    unused     1024  8192         # (Cyl.  131*- 459*)
  c:  2050860        0    4.2BSD     1024  8192    16   # (Cyl.    0 - 2569)
  d:   262144   104542    unused     1024  8192         # (Cyl.  131*- 459*)
  e:   262144   104542    unused     1024  8192         # (Cyl.  131*- 459*)
  f:   262144   104542    unused     1024  8192         # (Cyl.  131*- 459*)
  g:  1684174   366686    unused     1024  8192         # (Cyl.  459*- 2569*)
  h:   262144   104542    unused     1024  8192         # (Cyl.  131*- 459*)

In other words, you are now using cylinders 131-459 of your /home partition
as swap space.

Bottom Line
-----------
You need to remember that when you change your root devices SCSI address 
you must change the /sbin/swapdefault for the root device to avoid this 
situation.


-- 
jeff finkelstein                  | "Imagination is more important than
jlf@alf.dec.com                   |  knowledge."
digital equipment corporation     |         - Albert Einstein 
customer support center           |         


  reply	other threads:[~1993-10-07 20:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-10-06 22:50 swapdefault: How to hose a filesystem Chuck Henkel
1993-10-07 11:59 ` Wilko Bulte
1993-10-07 17:25   ` John T. Kohl
1993-10-07 20:57     ` Jeff Finkelstein [this message]
1993-10-08 21:03       ` Tero Kivinen
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox