[comp.sys.att] Disk Partitioning on 3b2's

demasi@paisana.UUCP (04/03/87)

Hello Folks,

I've seen some questions along this line in this group, so I thought
I'd give it a shot.  I'm S/A on a 3b2/400 running Sys V.2.0.4, and for 
some reason am having troubles partitioning the disks (2*72M) to the
recommended 23Meg limit for file systems.  I'm trying to accomplish
this by using the makefsys command on the disk partitions in single
user mode with the file systems unmounted.  (The alternate method,
doing a full restore from the core packs is impractical since the
machine is already in production, and I didn't know about the size
restrictions when I started this project)  

Things go well when I recreate /usr2 at the smaller size, but makefsys 
returns a read error when I try to create the other file systems on
the same disk.  Since I can create a file system in the same place as
where one already existed, I imagine that I am simply leaving out a step
to prepare the disk partition for a makefsys (or something close to
that.)  Everybody I have spoken to so far says that it must be possible
to repartition without doing a full restore, but nobody quite seems to
know what the missing step is.  Also, since I remade /usr2 to the
suggested size, backups have been going awry in that a backup of the
root system does not stop at the root system but continues up the file
tree (ie into /usr and so forth.)

Any ideas folks?
(I really don't want to do a full restore at this point)
-- 
Michael C. De Masi - AT&T Communications (For whom I work and not speak)
3702 Pender Drive, Fairfax, Virginia 22030   Phone: 703-246-9504
UUCP:   seismo!decuac!grebyn!paisana!demasi
     "No matter where you go, there you are" - Buckaroo Banzai

cwd@cuae2.UUCP (04/04/87)

Read the "Hard Disk Partitioning" Section in the System Administrator's
Guide (in Administrative Tasks major section) and look at the manual
page for /etc/fmthard (in the SA Reference Manual). Also, take a
look at the "sysadm partitioning" command. You'll get the idea.

Chris Donahue
AT&T Info. Sys.
Customer Systems Engineering

authorplaceholder@gorgo.UUCP.UUCP (04/05/87)

Chris Donahue writes:

>Read the "Hard Disk Partitioning" Section in the System Administrator's
>Guide (in Administrative Tasks major section) and look at the manual
>page for /etc/fmthard (in the SA Reference Manual). Also, take a
>look at the "sysadm partitioning" command. You'll get the idea.

I'll go one step further... The fmthard command is necessary since the 3B2 disk
partitioning is actually determined by vtoc stored on the disk. The fmthard
command writes a new vtoc onto the drive. This *always* cremes the data on
the drive, so take care. Note also that the filesystem boundaries need to
occur in correctly timed offsets on cylinder boundaries or performance will
suffer. "sysadm partitioning" knows about this necessity and will compensate
appropriately.

  Hope this helps,
   Steve Blasingame (Oklahoma City)
   bsteve@gorgo.att.com

jgy@hropus.UUCP (04/06/87)

> Chris Donahue writes:
> 
> >Read the "Hard Disk Partitioning" Section in the System Administrator's
> >Guide (in Administrative Tasks major section) and look at the manual
> >page for /etc/fmthard (in the SA Reference Manual). Also, take a
> >look at the "sysadm partitioning" command. You'll get the idea.
> 
> I'll go one step further... The fmthard command is necessary since the 3B2 disk
> partitioning is actually determined by vtoc stored on the disk. The fmthard
> command writes a new vtoc onto the drive. This *always* cremes the data on
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> the drive, so take care. Note also that the filesystem boundaries need to
> 

Not true, it does not touch the data on the disk, only the information
describing how to get to the data, rather like losing your inode area.
But it can be reversed with more ease!

leonard@acf4.UUCP (04/06/87)

I too, am running sysV, r2.0.4. However, I suggest getting your hands
on a copy of the release 3 System administrator's guide,(which has been
expanded from the release 2 manual)  and reading section 5 (File admin)
of the first part, and sections 4 & 5 of the second part.

Shanna Leonard

ARPA: leonard@acf4.nyu.edu

bsteve@gorgo.UUCP (04/08/87)

Chris Donahue responds:
>Not true, it does not touch the data on the disk, only the information
>describing how to get to the data, rather like losing your inode area.
>But it can be reversed with more ease!

This is correct... the clue is to be careful to SAVE a copy of the old
vtoc format OR spend lots of time guessing. I have had old drives with a
marginal sector right on the vtoc and have successfully restored the vtoc
data from time to time and kept right on truckin on the old drive.

Here is an example of an old vtoc which splits a 72MB drive into 2 parts:

* Partition	ID	Flag	Start Sector	Size in Sectors
   05		0	01	0		0
   06		0	01	0		148896
   07		0	01	0		198
   08		0	00	198		74250
   09		0	00	74250		74448
   10		0	01	0		0

One might use only partition 8 for live data, reserving partition 9 for
future use. Later when partition 9 becomes used it might be desirable to
split it into 2 parts as is shown below.

* Partition	ID	Flag	Start Sector	Size in Sectors
   05		0	01	0		0
   06		0	01	0		148896
   07		0	01	0		198
   08		0	00	198		74250
   09		0	00	74250		37224
   10		0	00	111474		37224

Here we've used partition 10 also in reallocation of the drive while
preserving the data in partition 8.

Meaning of flags are as follows:
  00 = mountable
  01 = non-mountable
  10 = read-only

For safety's sake, ALWAYS save the existing vtoc data using /etc/prtvtoc
before making ANY changes and (of course) have a good backup.

  Something in the form: # /etc/prtvtoc /dev/rdsk/c2d1s0 >/etc/vtoc/c2d1s0
  Then copy the text file and make changes...
                  # cp /etc/vtoc/c2d1s0 /etc/vtoc/whatever
  Then to update the drive:
                  # /etc/fmthard -s /etc/vtoc/whatever /dev/rdsk/c2d1s0

If you have messed up the data somehow you can get back the old vtoc data
by typing: # /etc/fmthard -s /etc/vtoc/c2d1s0 /dev/rdsk/c2d1s0

For more concise information regarding this procedure and about creating
filesystems on the new partitions read the documentation as this can also be
a dangerous procedure. One can re-partition a drive using the menu-driven
simple administration, but it is not always guaranteed that the partitions
will fall where you want them and prevent you from clobbering existing data,
particularly if the drive was not initially partitioned using the simple-
administration menus.

  Hope this helps,
   Steve Blasingame (AT&T Oklahoma City)
   bsteve@gorgo.att.com
   ihnp4!gorgo!bsteve

mdb@laidbak.UUCP (04/18/87)

> [Chris Donahue]
> ...
> partitioning is actually determined by vtoc stored on the disk. The fmthard
> command writes a new vtoc onto the drive. This *always* cremes the data on
> the drive, so take care. Note also that the filesystem boundaries need to
> ...

The 3B2 /etc/fmthard command replaces the VTOC (partition map) of a hard
disk. It does not damage the contents of the partitions.

Note that /etc/fmthard does, however, make a disk non-bootable; it zeroes
the VTOC words which point at the second-level bootstrap. Use "/etc/newboot
/lib/lboot /lib/mboot /dev/rdsk/c-d-s7" to reinstall the bootstrap.

					Mark Brukhartz
					Lachman Associates, Inc.
					..!{ihnp4, sun}!laidbak!mdb