Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Oct 2015 15:04:34 -0453.75
From:      "William A. Mahaffey III" <wam@hiwaay.net>
Cc:        FreeBSD Questions !!!! <freebsd-questions@freebsd.org>
Subject:   Re: Install issues
Message-ID:  <5612D688.9070108@hiwaay.net>
In-Reply-To: <5612D59D.4030000@hiwaay.net>
References:  <5612938F.4080508@hiwaay.net> <20151005173644.d3b9c5ce.freebsd@edvax.de> <5612D59D.4030000@hiwaay.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------010706020409070106000706
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit

On 10/05/15 14:59, William A. Mahaffey III wrote:
> On 10/05/15 10:42, Polytropon wrote:
>> On Mon, 5 Oct 2015 10:18:49 -0453.75, William A. Mahaffey III wrote:
>>> I am attempting to provision a new box w/ FreeBSD 9.3R, using a
>>> customized USB drive w/ the default install media plus some scripts I
>>> conjured up to expedite partitioning/slicing of HDD's. I plugged the 
>>> USB
>>> stick in & powered on. Though the UEFI BIOS gave my no options to
>>> configure boot order, it did figure out that the USB stick was there &
>>> bootable. I booted from that & the loading proceeded up to the regular
>>> FreeBSD 'choose boot options' screen, w/ multi-user, single user, etc.
>>> (6 choices total, w/ the ASCII-art logo). I let it go w/ option 1 (bad
>>> choice :-) ? ) & it failed to get booted, but gave me a choice of boot
>>> devices at the 'mountfs' (or some such) prompt.
>> mountroot> :-)
>>
>> It's being presented by the kernel's root partition mounting
>> mechanism (see sys/kern/vfs_mount.c).
>>
>>
>>
>>> I entered
>>> 'ufs:/dev/da0s1a rw' & it proceeded to boot the installer.
>> If I remember correctly, the boot process will mount root
>> read-only, this is the default behaviour of single-user mode.
>> That's why there is no "rw" option at this prompt; "rw" will
>> therefore be ignored. Otherwise, the options from /etc/fstab
>> would apply.
>>
>>
>>
>>> At 1st
>>> prompt, i chose 'Shell' & dropped to the shell to run my utilities. The
>>> 1st problem was that the USB media was mounted 'ro', *not* 'rw' as I
>>> asked, making it tough to log what was going on to use in queries such
>>> as this one when problems arose. My script completed down to an 
>>> error in
>>> an innocuous echo statement, but subsequent df revealed no customized
>>> partitions visible for the install to proceed with, & little way to
>>> discern what had happened, since everything scrolled past too fast & 
>>> too
>>> far to recover.
>> The df command will only consider _mounted_ partitions. Check
>> for the device nodes (and maybe labels) - if they are available,
>> mount them, then use df.
>>
>> The command would be "mount -uw /", or "mount -u -o rw /".
>>
>> The ability to write to / maybe is the problem why no further
>> partitions got mounted...?
>>
>>
>>
>>> I never found a magic key-stroke combo to page up in
>>> console mode, so I am mostly in the dark.
>> There is a nice little key, called "Scroll Lock", and it actually
>> does what's printed on it: it locks the screen (cursor disappears)
>> and you can use the vertical cursor keys and page keys to scroll
>> up and down. Press the lock key again, and you can continue where
>> you left the screen. Maybe the key is so old and so obvious that
>> you didn't see it. :-)
>>
>> No, seriously: Scroll Lock isn't supported on many systems to
>> work as it should. FreeBSD is an excellent exception here.
>>
>>
>>
>>> Is there a way to force the
>>> booted root drive to be mounted 'rw' ?
>> Probably you can do this with a custom entry in /etc/rc.local (if
>> the boot image processes /etc/rc).
>>
>>
>>
>>
>>
>
> OK, I got past these 1st few (low) hurdles, now for some meatier 
> issues: For some reason, my script still didn't produce valid 
> partitions/slices, see attached, from I/O tee'ed out of the install 
> process. I also attach the script I am trying to use, see 2nd 
> attachment. I did a few tinkers durinstall, see commented out stuff, 
> but I still wind up w/ no useful partitions based on what is in /dev 
> (no /dev/stripe or /dev/mirror directory, never mind any entries 
> there). I will add more echo's as needed. I (thought I) copied most of 
> the gpart commands & args, as well as order, straight out of the 
> online wiki, but maybe not.


Hmmmm .... I *KNOW* I attached the script I used, but it didn't make it 
through .... Does the list strip off '.sh' files ?

-- 

	William A. Mahaffey III

  ----------------------------------------------------------------------

	"The M1 Garand is without doubt the finest implement of war
	 ever devised by man."
                            -- Gen. George S. Patton Jr.


--------------010706020409070106000706
Content-Type: text/plain; charset=UTF-8;
 name="setupRootOnMirroredMBR-UFS2X.sh.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="setupRootOnMirroredMBR-UFS2X.sh.txt"

#!/bin/sh

# Install FreeBSD 9.3R on gmirror/gstripe UFS partitions (GPT or MBR), 2 HDD's.

# FreeBSD 9.3R has nice and simple partition editor (Expert mode).
# Still, if you want gmirror/gstripe setup you have to use "Shell" mode and do things manually.
# This guide will help you create a FreeBSD system using gmirror/gstripe by hand.

# Boot from FreeBSD 9.3R installation media.
# Start installation, answer the questions until you endup on "Partitioning" screen. Choose "Shell" here.

# If the drives are *NOT* empty:

gpart destroy -F ada0
gpart destroy -F ada1

# Partition the drives (MBR)
# Create MBR partition table

# If the drive is empty:

# gpart create -s mbr -a 4k ada0
# gpart create -s mbr -a 4k ada1

gpart create -s mbr ada0
gpart create -s mbr ada1

echo "Progress so far (create -s mbr ada[0,1]):"; echo ' '; gpart show	# see what we have so far ....

# Create MBR slices for FreeBSD

# gpart add -t freebsd -b 64 -a 4k ada0
# gpart add -t freebsd -b 64 -a 4k ada1

gpart add -t freebsd -a 4k ada0
gpart add -t freebsd -a 4k ada1

echo "Progress so far (add -t freebsd -a 4k ada[0,1]):"; echo ' '; gpart show	# see what we have so far ....

gpart create -s bsd ada0s1
gpart create -s bsd ada1s1

echo "Progress so far (create -s bsd ada[0,1]s1):"; echo ' '; gpart show	# see what we have so far ....

# This example shows how to create mirrored & striped UFS partitions. This is just an example, you might want to rethink which partitions will be striped, mirrored or simple.

# Create partitions on the first disk

# There will be no ada0s1c (or index -i 3) because partition "c" is a special entry covering entire slice and is not used for filesystem.

gpart add -s 4G -t freebsd-ufs  -l root1 -a 4k ada0s1	# Create root (/) partition (will be mirrored, needs ada1s1a)
gpart add -s 8G -t freebsd-swap -l swap1 -a 4k ada0s1	# Create swap partition
gpart add -s 8G -t freebsd-ufs  -l  var1 -a 4k ada0s1	# Create root (/var) partition (will be striped, needs ada1s1d)
gpart add -s 8G -t freebsd-ufs  -l ulcl1 -a 4k ada0s1	# Create root (/usr/local) partition (will be striped, needs ada1s1e)
# glabel label swap1 /dev/ada0s1b
gpart add       -t freebsd-ufs  -l home1 -a 4k ada0s1	# Create /home partiton (will be striped, needs ada1s1f)

# Last partition is added without -s (size) so it will cover the rest of the available space.
# Install boot code

# Install FreeBSD boot manager:
# gpart bootcode -b /boot/boot0 ada0		# Possibly unnecessary ?!?!?!
# gpart bootcode -b /boot/boot  ada0s1		# Possibly unnecessary ?!?!?!

# Create partitions on the second disk

# There will be no ada1s1c (or index -i 3) because partition "c" is a special entry covering entire slice and is not used for filesystem.

gpart add -s 4G -t freebsd-ufs  -l root2 -a 4k ada1s1	# Create root (/) partition (will be mirrored, needs ada0s1a)
gpart add -s 8G -t freebsd-swap -l swap2 -a 4k ada1s1	# Create swap partition
gpart add -s 8G -t freebsd-ufs  -l  var2 -a 4k ada1s1	# Create root (/var) partition (will be striped, needs ada0s1d)
gpart add -s 8G -t freebsd-ufs  -l ulcl2 -a 4k ada1s1	# Create root (/usr/local) partition (will be striped, needs ada0s1e)
# glabel label swap2 /dev/ada1s1b
gpart add       -t freebsd-ufs  -l home2 -a 4k ada1s1	# Create /home partiton (will be striped, needs ada0s1f)

# Last partition is added without -s (size) so it will cover the rest of the available space.
# Install boot code

# Install FreeBSD boot manager:
# gpart bootcode -b /boot/boot0 ada1		# Possibly unnecessary ?!?!?!
# gpart bootcode -b /boot/boot  ada1s1		# Possibly unnecessary ?!?!?!

echo "Progress so far (almost done):"; echo ' '; gpart show	# see what we have so far ....

# Create mirrored/striped UFS filesystems (MBR)
# Create filesystems

# Load required kernel modules:

# kldload geom_mirror
# kldload geom_stripe

# OR:

gmirror load
gstripe load

# Filesystems are formatted using newfs utility, -L is the label, filesystem will be available as /dev/ufs/label, and -U turns Soft Updates on.

gmirror label -v root /dev/ada0s1a /dev/ada1s1a		# Mirrored UFS partitions: currently only root ....

# Install simple MBR boot loader (boots active slice):
gpart bootcode -b /boot/mbr mirror/root
gpart set -a active -i 1 mirror/root
gpart bootcode -b /boot/boot mirror/roots1

# Install FreeBSD boot manager:
# gpart bootcode -b /boot/boot0 mirror/root	# feasible ?!?!?!
# gpart bootcode -b /boot/boot  mirror/roots1	# feasible ?!?!?!

# gpart bootcode -b /boot/boot0 root		# feasible ?!?!?!
# gpart bootcode -b /boot/boot  roots1		# feasible ?!?!?!

newfs -U -L root /dev/mirror/root		# Now setup actual FS ....
mount /dev/mirror/root /mnt			# & mount it where the installer expects to find it.

gstripe label -v var /dev/ada0s1d /dev/ada1s1d	# Striped UFS partitions: /var ....
newfs -U -L var /dev/stripe/var			# Now setup actual FS ....
mount /dev/stripe/var /mnt/var			# & mount it where the installer expects to find it.

gstripe label -v usrlocal /dev/ada0s1e /dev/ada1s1e	# Striped UFS partitions: /usr/local ....
newfs -U -L usr/local /dev/stripe/usrlocal		# Now setup actual FS ....
mkdir /mnt/usr/local					# create mountpoint ....
mount /dev/stripe/usrlocal /mnt/usr/local		# & mount it where the installer expects to find it.

gstripe label -v home /dev/ada0s1f /dev/ada1s1f		# Striped UFS partitions: /home ....
newfs -U -L home /dev/stripe/home			# Now setup actual FS ....
mount /dev/stripe/home /mnt/home			# & mount it where the installer expects to find it.

# Type exit and installation will proceed.

echo Now \(IMPORTANT \!\!\!\!\) type exit to return to the installer and installation will proceed.
 

--------------010706020409070106000706--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5612D688.9070108>