Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* swapdefault: How to hose a filesystem
@ 1993-10-06 22:50 Chuck Henkel
  1993-10-07 11:59 ` Wilko Bulte
  0 siblings, 1 reply; 5+ messages in thread
From: Chuck Henkel @ 1993-10-06 22:50 UTC (permalink / raw)


Say, if you get the idea to move filesystems around on your disks, be
sure that the /sbin/swapdefault file points to the correct partition
when you're done. 

Else, the system may decide to swap right in the middle of a data
filesystem and it will take you the greater part of a day to figure
out why certain files are mysteriously getting corrupted, and the rest
of the day to figure out that the "swapdefault" file even exists.

--
Chuck Henkel                      
Westinghouse Savannah River Company
csh@srs.gov


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: swapdefault: How to hose a filesystem
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Wilko Bulte @ 1993-10-07 11:59 UTC (permalink / raw)


csh@srs.gov (Chuck Henkel) writes:

>Say, if you get the idea to move filesystems around on your disks, be
>sure that the /sbin/swapdefault file points to the correct partition
>when you're done. 

>Else, the system may decide to swap right in the middle of a data
>filesystem and it will take you the greater part of a day to figure
>out why certain files are mysteriously getting corrupted, and the rest
>of the day to figure out that the "swapdefault" file even exists.

Hmm, I did something similar once and swapon objected that the particular
partition was mounted. Your swapdefault points to the default swap device,
is apparantly not checked.

Just beware!
\
Wilko
--
 |   / o / /  _   Wilko Bulte               mail: wilko@idca.tds.philips.nl
 |/|/ / / /( (_)  |d|i|g|i|t|a|l| Equipment Corporation voice: +3155-432062
fax: +3155-432103 DTN: 829 2062 PO Box 245 - 7300 AE Apeldoorn - The Netherlands


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: swapdefault: How to hose a filesystem
  1993-10-07 11:59 ` Wilko Bulte
@ 1993-10-07 17:25   ` John T. Kohl
  1993-10-07 20:57     ` Jeff Finkelstein
  0 siblings, 1 reply; 5+ messages in thread
From: John T. Kohl @ 1993-10-07 17:25 UTC (permalink / raw)


In article <wilko.749995146@spoetnix.idca.tds.philips.nl> wilko@idca.tds.philips.nl (Wilko Bulte) writes:

> >Else, the system may decide to swap right in the middle of a data
> >filesystem ...

> Hmm, I did something similar once and swapon objected that the particular
> partition was mounted. Your swapdefault points to the default swap device,
> is apparantly not checked.

When I was at Digital, I ran into the problem of swapping in the middle
of an active file system.  Being in the file system group, I modified
ufs_fsck, mount, swapon, newfs to verify that active swap partitions and
filesystems don't overlap each other.  This change was shipped with DEC
OSF/1 V1.3.  For example (not the "in use as swap" message):

/sbin/ufs_fsck /dev/rrz3h
** /dev/rrz3h
/dev/rrz3h overlaps mounted filesystem(s) or an active swap area
Unmount or reboot required before fsck on /dev/rrz3h (start 0 end 199999)
        /dev/rz3b in use as swap (start 103222 end 539381)
/dev/rrz3h overlaps mounted filesystem(s) or an active swap area
Unmount or reboot required before fsck on /dev/rrz3h (start 0 end 199999)
        /dev/rz3a mounted on / (start 0 end 103221)

--
John Kohl <jtk@atria.com> or <jtkohl@mit.edu>
working for but not representing:	Atria Software
---------
What are you pretending not to know?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: swapdefault: How to hose a filesystem
  1993-10-07 17:25   ` John T. Kohl
@ 1993-10-07 20:57     ` Jeff Finkelstein
  1993-10-08 21:03       ` Tero Kivinen
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Finkelstein @ 1993-10-07 20:57 UTC (permalink / raw)



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           |         


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: swapdefault: How to hose a filesystem
  1993-10-07 20:57     ` Jeff Finkelstein
@ 1993-10-08 21:03       ` Tero Kivinen
  0 siblings, 0 replies; 5+ messages in thread
From: Tero Kivinen @ 1993-10-08 21:03 UTC (permalink / raw)


In article <291vs1$ock@netnews.alf.dec.com> jlf@ryhope.alf.dec.com (Jeff Finkelstein) writes:
> 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*)

You should always create disklabels in a such way that partitions that
are not in use, cannot be used. This can be done by setting all values
to zero:

8 partitions:
#        size   offset    fstype   [fsize bsize   cpg]
  a:      798        0    unused        0     0         # (Cyl.    0 - 0)
  b:        0        0    unused        0     0         # (Cyl.    0 - 0)
  c:  2050860        0    unused     1024  8192    16   # (Cyl.    0 - 2569)
  d:  2050062      798    4.2BSD     1024  8192    16   # (Cyl.    1 - 2569)
  e:        0        0    unused        0     0         # (Cyl.    0 - -1)
  f:        0        0    unused        0     0         # (Cyl.    0 - -1)
  g:        0        0    unused        0     0         # (Cyl.    0 - -1)
  h:        0        0    unused        0     0         # (Cyl.    0 - -1)

If you don't have b partition the swapon cannot swap on it. It is also
much easier to guess which partions are in use if you happen to loose
/etc/fstab or something other goes wrong (somebody write 40MB of junk
in the begining of the disk or some other disaster).

> 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.

And don't create partitions in disklabel, that you don't use!
--
Tero_Kivinen@hut.FI              Work : +358-0-451 4032
Klovinrinne 6b, 02180, Espoo     Home : +358-0-524 207


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1993-10-08 21:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
1993-10-08 21:03       ` Tero Kivinen

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