How to Resolve ZFS Mount Point Problems

Ноябрь 27, 2009 at 1:54 пп (помойка справочной инфы) ()

Boot the system from a failsafe archive.

Import the pool.

For example:

# zpool import rpool

Review the zfs list output after the pool is imported.

Look for incorrect temporary mount points. For example:

# zfs list -r -o name,mountpoint rpool/ROOT/s10u6
 

 

 NAME                               MOUNTPOINT
 rpool/ROOT/s10u6                   /.alt.tmp.b-VP.mnt/
 rpool/ROOT/s10u6/zones             /.alt.tmp.b-VP.mnt//zones
 rpool/ROOT/s10u6/zones/zonerootA   /.alt.tmp.b-VP.mnt/zones/zonerootA

The mount point for the root BE (rpool/ROOT/s10u6) should be /.

If the boot is failing because of /var mounting problems, look for a similar incorrect temporary mount point for the /var dataset.

Reset the mount points for the ZFS BE and its datasets.

For example:

# zfs inherit -r mountpoint rpool/ROOT/s10u6
# zfs set mountpoint=/ rpool/ROOT/s10u6

Reboot the system.

When the option is presented to boot a specific boot environment, either in the GRUB menu or at the OpenBoot Prom prompt, select the boot environment whose mount points were just corrected.

Постоянная ссылка 1 комментарий

Creating a bootable ZFS Filesystem

Ноябрь 27, 2009 at 10:04 дп (помойка справочной инфы) ()

1. Boot FreeBSD install DVD

1. Choose Fixit option in sysinstall

1. Create GPT Disks

Fixit# gpart create -s gpt ad0
Fixit# gpart create -s gpt ad1
Fixit# gpart create -s gpt ad2

1. Create the boot, swap and zfs partitions

Create 3 partitions on drives ad0, ad1 and ad2. The first partition contains the gptzfsboot loader which is able to recognize and load the loader from a [[ZFS]] partition. The second partition is a 4 GB swap partition. The third partition is the partition containing the zpool (60GB).

Fixit# gpart add -b 34 -s 128 -t freebsd-boot ad0
Fixit# gpart add -b 162 -s 8388608 -t freebsd-swap -l swap0 ad0
Fixit# gpart add -b 8388770 -s 125829120 -t freebsd-zfs -l disk0 ad0

 

Fixit# gpart add -b 34 -s 128 -t freebsd-boot ad1
Fixit# gpart add -b 162 -s 8388608 -t freebsd-swap -l swap1 ad1
Fixit# gpart add -b 8388770 -s 125829120 -t freebsd-zfs -l disk1 ad1

 

Fixit# gpart add -b 34 -s 128 -t freebsd-boot ad2
Fixit# gpart add -b 162 -s 8388608 -t freebsd-swap -l swap2 ad2
Fixit# gpart add -b 8388770 -s 125829120 -t freebsd-zfs -l disk2 ad2

”’Note:”’ 1. While a [[RootOnZFS|ZFS Swap Volume]] can be used instead of the freebsd-swap partition, crash dumps can’t be created on the ZFS Swap Volume. 1. Sizes and offsets are specified in sectors (1 sector is typically 512 bytes).

1. Set partition active (Optional)

Some BIOSes might require setting a Slice active. Here we set partition 1 as the active partition.

Fixit# gpart set -a active -i 1 ad0

”’Note:”’ This is no longer required on 9-CURRENT, as installing the bootcode will mark the partition active.

1. Install the Protected MBR (pmbr) and gptzfsboot loader to both drives

Fixit# gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 ad0
Fixit# gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 ad1
Fixit# gpart bootcode -b /mnt2/boot/pmbr -p /mnt2/boot/gptzfsboot -i 1 ad2

This may fail with an “operation not permitted” error message, since the kernel likes to protect critical parts of the disk. If this happens for you, run:

Fixit# sysctl kern.geom.debugflags=0x10

1. Load ZFS kernel module

Fixit# kldload /mnt2/boot/kernel/opensolaris.ko
Fixit# kldload /mnt2/boot/kernel/zfs.ko

1. Create ZFS Pool zroot

Fixit# mkdir /boot/zfs
Fixit# zpool create zroot raidz1 /dev/gpt/disk0 /dev/gpt/disk1 /dev/gpt/disk2
Fixit# zpool set bootfs=zroot zroot

”’Note:”’ 1. zroot is the name of the ZFS Pool, it could be anything (i.e. tank, data, …) 1. A raidz1 pool requires a minimum of 3 disks and a maximum of 9 disks

<>

== Finish install ==

1. Create /etc/fstab

Fixit# cat << EOF > /zroot/etc/fstab
# Device			Mountpoint		FStype	Options		Dump	Pass#
/dev/gpt/swap0			none			swap	sw		0	0
/dev/gpt/swap1			none			swap	sw		0	0
/dev/gpt/swap2			none			swap	sw		0	0
EOF

1. export LD_LIBRARY_PATH

Fixit# export LD_LIBRARY_PATH=/mnt2/lib

1. Unmount all zfs filesystems

Fixit# zfs unmount -a

1. Change mount points for zroot pool

Fixit# zfs set mountpoint=legacy zroot
Fixit# zfs set mountpoint=/tmp zroot/tmp
Fixit# zfs set mountpoint=/usr zroot/usr
Fixit# zfs set mountpoint=/var zroot/var

1. Exit Fixit mode, and then sysinstall. Remove the FreeBSD install CD and the system will boot using the ZFS root.

http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/RAIDZ1
http://blogs.freebsdish.org/lulf/2008/12/16/setting-up-a-zfs-only-system/
http://f-andrey.blogspot.com/2009/01/freebsd-zfs.html

Постоянная ссылка 1 комментарий

Follow

Get every new post delivered to your Inbox.