*BSD News Article 32764


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!usc!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!news2.near.net!noc.near.net!news.delphi.com!BIX.com!arog
From: arog@BIX.com (arog on BIX)
Newsgroups: comp.os.386bsd.questions
Subject: Re: Can I split FreeBSD over two physical drives
Date: 12 Jul 94 07:48:38 GMT
Organization: Delphi Internet Services Corporation
Lines: 162
Message-ID: <arog.773999318@BIX.com>
References: <MATHEZER.94Jul10125642@fsj.cpsc.ucalgary.ca>
NNTP-Posting-Host: bix.com

mathezer@cpsc.ucalgary.ca (Stephen Mathezer) writes:


>I would like to put my root partition, and maybe another small
>partition on one drive, and the rest of FreeBSD my second drive.

>Can this be done, and if so how?

>BTW in this scenario, where would swap go?

>-Steve

Ok, I"ve just worked my way through this... and I'll proly
post a more detailed explanation later... however to get you
going, here is a quick.n.dirty hack.list for the job.

This project has several problems to it. The first is to
create a paritioned fixeddisk that has no 'swap' partition. 
The second is to generate the needed files for the mount
to occur. Third, is to get enough of the tools installed
to be able to do the job.

The worst of this approch is that it means doing a number of
complete insalls. 

First, I'd take the larger fixeddisk, one that is large enough
that a minimum swap can be created and still have enough room
for a full install of the binary distribution. This gives you
the tools to do the needed file.hacking. 

Now, create a *second* 'filesystem' floppy and label it as
something like 'no_swap_install'. (use whatever machine
and methode that was used to make the other boot floppies.)

[also, there is no need to install the security distribution
at this point]

I'll suggest creating the file system that will end up being
your root filesystem first. Go through installing the cpio
disk and stop there. 

Now, assuming that the second disk is larger (my case), remove 
the first disk from the system and install the second one. 
Do a complete install with perhaps the exception of the secdist.
Extract the files so that you have the tools needed for what follows.

*DO*NOT* delete the bin_tgz.* files. With luck, you'll not 
have to reload them from floppy again. 

Note where your utilities live and their path from the root
of that filesystem. Specifically, /bin/cat, mv, rm; /sbin/mount,
halt; /etc/disktab.install, fstab.

As root (since that already there and this install is going
to be trashed anyway, why create another one and worry about
its privs), mount that second filesystem floppy, the form 
for the command being, 'mount /dev/fd0.1440' or what ever 
the spec should be for your fd0 on '/mnt'. cd to /mnt.
ls will show a number of files, including 'install'. Being 
a conservative type, cp install no_swap_install. Now, 
bring up vi no_swap_install and look for the item 
"SWAPMIN=8" and change the 8 to 0. Once that is done, 
search on the string, "oping to disk". The correct entry
starts an area that reads:

	echo 
	echo -n "Copying to disk ... "
	cd /
	cpio ... [rest deleted]

Ok, delete from that first echo to the end. [ :.,$d does it ]
Write the file out to disk (on the floppy) and exit vi. 

Now, edit the .profile on the floppy. Its last line is
"/install". Delete it. That will (or should) bring you
to a "#" prompt and you can invoke your hacked.script
from there. 

Halt the system. If you can, install your future root drive
as a second drive and reboot. I forgot to say this earlier, 
but I suppose that one could have done this when this drive was
moved to the wd0 position and have saved this re-boot. 

Mount the future root on /mnt. cd to it and take a look with 
ls at a couple of directories to see that its working right. 
While all of this may sound like "I know what I'm doing,"
this is my first pass at this level of hackery and I'm not
sure if the second drive at this point is referenced as
/dev/wd1a or /dev/wd1c. Mounted wrong and things get strange
and break. 

Ok, so now make a safe on the second volume (/mnt/safe would
be a nice directory name) and cp all of those bin_tgz files
into it. While you have a path, cd to /mnt/etc and cp
fstab there to a new file name, such as fsab.orig
and do the same with disktab.install. This cuts down 
on the work that will be needed in a bit.

Now, halt the system. Reboot from the kernel floppy
but when it asks for the file system floppy, use the
new one with the hacked script instead. Run your hacked
script at the prompt. Answer the questions as before, 
but this time, it will allow Zero swap space. While I did
not, I expect that the disk could be divided into a couple
of BSD partitions at this point. The script should
run through to its end complete with bad144, assuming
that the disk does not automatically deal with bad sectors
for itself. 

Halt the system. Put everything the way you want it
to be for operation. (Yes, were almost done.)

Now, boot from the hard disk that is already wanting
to have the bin_tgz files feed to it. In that this is
the first time that its been booted, I think that this
is where it cleans things up and automatically reboots 
itself once. 

First, mount that second filesystem floppy. The one that was
used to create the single.filesystem drive. cd to /etc (on
the root fixeddisk.) cat /mnt/etc/disktab /etc/disktab.install.orig
>> disktab.install . Edit /etc/fstab. The last line will
be something like:

	/dev/wd0c	/	ufs	rw	1 1

Copy that line and then change it at two places. As an example,
my edited file has:

	/dev/sd0c	/	ufs	rw	1 2

So, the first place to change is the device entry and the second
is that last "1" gets changed to "2" so that fsck knows to run
on that one second. 

Almost there... one last set of things to do. 

Use *"mv"* to take all of the files in the /usr directory
tree to a temporary tree. I used /tuser. You cannot use
"cp" for this. cp breaks links. mv keeps them. Umount
the second drive and remount it on /usr. Now check and
see how those files from /usr got placed in /tuser. If the
sysntax is wrong, they'll end up in /tuser/usr. As I recall, 
if they are in '/tuser/usr'", 'mv /tuser/usr/* /usr'
will get them into the right positions. 

At this point, you should be able to halt the system
and to reboot to the same point as you were when it booted
this time... and then go to the directory where you copied
the bin_tgz files, set the temp dir (if its needed at all
this way) and to extract bin_tgz... all with the /usr
partion automounted and cleaned by fsck on boot. 

... and I hope that I've not left some killer item out
    of all of this.

.............................................................
Alan Ogden, Moderator of nos, cad, ham.radio, west.coast, disasters,
            and other conferences on BIX.
arog@BIX.com