# FreeBSD install on zfs raid 1



## Solaris (Oct 3, 2010)

Hello, I am following this guide: http://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/Mirror, but when finished the installation and booting to fresh installed it throw error:


```
can't exec getty '/usr/libexec/getty' for port /dev/ttyv0
can't exec getty '/usr/libexec/getty' for port /dev/ttyv1
can't exec getty '/usr/libexec/getty' for port /dev/ttyv2
can't exec getty '/usr/libexec/getty' for port /dev/ttyv3
can't exec getty '/usr/libexec/getty' for port /dev/ttyv4
can't exec getty '/usr/libexec/getty' for port /dev/ttyv5
can't exec getty '/usr/libexec/getty' for port /dev/ttyv6
can't exec getty '/usr/libexec/getty' for port /dev/ttyv7
```

What would be the problem? I am really confused because this is the second attempt after I was following another tutorial. I am installing FreeBSD 8.1 amd64.


----------



## kpa (Oct 3, 2010)

How are your mountpoints for the zfs filesystems? That sounds like /usr is not mounted where it should be.


----------



## Solaris (Oct 3, 2010)

Hmm after hard reset it seem all zfs mountpoints and pool gone, zpool status -v and zfs list says "no datasets available", only gmirror left in :

```
Geom name: swap
State: COMPLETE
Components: 2
Balance: prefer
Slice: 4096
Flags: NONE
GenID: 0
SyncID: 1
ID: 3380989592
Providers:
1. Name: mirror/swap
   Mediasize: 8589934080 (8.0G)
   Sectorsize: 512
   Mode: r0w0e0
Consumers:
1. Name: ad3p2
   Mediasize: 8589934592 (8.0G)
   Sectorsize: 512
   Mode: r1w1e1
   State: ACTIVE
   Priority: 1
   Flags: NONE
   GenID: 0
   SyncID: 1
   ID: 509236161
2. Name: ad1p2
   Mediasize: 8589934592 (8.0G)
   Sectorsize: 512
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: NONE
   GenID: 0
   SyncID: 1
   ID: 4027027904
```

gpart clearly shown it's still there o_0; :

```
=>       34  976770988  ad1  GPT  (466G)
         34        128    1  freebsd-boot  (64K)
        162       1886       - free -  (943K)
       2048   16777216    2  freebsd-swap  (8.0G)
   16779264  959991758    3  freebsd-zfs  (458G)

=>       34  976773101  ad3  GPT  (466G)
         34        128    1  freebsd-boot  (64K)
        162       1886       - free -  (943K)
       2048   16777216    2  freebsd-swap  (8.0G)
   16779264  959993871    3  freebsd-zfs  (458G)

=>     63  7959483  da0  MBR  (3.8G)
       63  7959489    1  !12  [active]  (3.8G)
```


----------



## kpa (Oct 3, 2010)

Boot into Fixit and do:
`# mkdir /boot/zfs`

`# kldload /mnt2/boot/kernel/opensolaris.ko`

`# kldload /mnt2/boot/kernel/zfs.ko`

`# zpool import -f -R /altroot poolname`

That should mount your pool under /altroot except for datasets (filesystems) that have mountpoint set to legacy, root file system for example.


----------



## Solaris (Oct 3, 2010)

Thanks, now it showed up, here it is :

```
NAME                            USED  AVAIL  REFER  MOUNTPOINT
zroot                      1016M   448G   282M  legacy
zroot/tmp                    18K   448G    18K  /altroot/tmp
zroot/usr                   734M   448G   233M  /altroot/usr
zroot/usr/home               18K   448G    18K  /altroot/usr/home
zroot/usr/ports             199M   448G   199M  /altroot/usr/ports
zroot/usr/ports/distfiles    18K   448G    18K  /altroot/usr/ports/distfiles
zroot/usr/ports/packages     18K   448G    18K  /altroot/usr/ports/packages
zroot/usr/src               302M   448G   302M  /altroot/usr/src
zroot/var                   304K   448G   110K  /altroot/var
zroot/var/crash            18.5K   448G  18.5K  /altroot/var/crash
zroot/var/db                 82K   448G    64K  /altroot/var/db
zroot/var/db/pkg             18K   448G    18K  /altroot/var/db/pkg
zroot/var/empty              18K   448G    18K  /altroot/var/empty
zroot/var/log                18K   448G    18K  /altroot/var/log
zroot/var/mail               18K   448G    18K  /altroot/var/mail
zroot/var/run                21K   448G    21K  /altroot/var/run
zroot/var/tmp                19K   448G    19K  /altroot/var/tmp
```


```
pool: zroot
 state: ONLINE
 scrub: none requested
config:

	NAME           STATE     READ WRITE CKSUM
	zroot      ONLINE           0     0     0
	  mirror       ONLINE       0     0     0
	    gpt/disk0  ONLINE       0     0     0
	    gpt/disk1  ONLINE       0     0     0

errors: No known data errors
```

Is there anything wrong ?


----------



## kpa (Oct 3, 2010)

Check the real mountpoints with: 

`# zfs get mountpoint`

What you are seeing in Fixit are the altroot mountpoints (because you specified -R option for zpool) that are always temporary assignments and disappear on reboot.


----------



## Solaris (Oct 3, 2010)

```
NAME                           PROPERTY    VALUE                          SOURCE
zroot                      mountpoint  legacy                         local
zroot/tmp                  mountpoint  /altroot/tmp                   local
zroot/usr                  mountpoint  /altroot/usr                   local
zroot/usr/home             mountpoint  /altroot/usr/home              inherited from zroot/usr
zroot/usr/ports            mountpoint  /altroot/usr/ports             inherited from zroot/usr
zroot/usr/ports/distfiles  mountpoint  /altroot/usr/ports/distfiles   inherited from zroot/usr
zroot/usr/ports/packages   mountpoint  /altroot/usr/ports/packages    inherited from zroot/usr
zroot/usr/src              mountpoint  /altroot/usr/src               inherited from zroot/usr
zroot/var                  mountpoint  /altroot/var                   local
zroot/var/crash            mountpoint  /altroot/var/crash             inherited from zroot/var
zroot/var/db               mountpoint  /altroot/var/db                inherited from zroot/var
zroot/var/db/pkg           mountpoint  /altroot/var/db/pkg            inherited from zroot/var
zroot/var/empty            mountpoint  /altroot/var/empty             inherited from zroot/var
zroot/var/log              mountpoint  /altroot/var/log               inherited from zroot/var
zroot/var/mail             mountpoint  /altroot/var/mail              inherited from zroot/var
zroot/var/run              mountpoint  /altroot/var/run               inherited from zroot/var
zroot/var/tmp              mountpoint  /altroot/var/tmp               inherited from zroot/var
```


----------



## kpa (Oct 3, 2010)

Hmm that didn't quite work. I assumed `# zfs get mountpoint` would show the actual mountpoints the system would use when booted. I don't have a system to test the same procedure on right now... Can you see if /altroot/usr/libexec/getty exists?


----------



## Solaris (Oct 3, 2010)

Which one didn't quite work? My setup? Or the tutorial?

Strange after again hard reboot, now only tmp/ usr/ var/ shows up, before I perfectly sure there is complete directory of all defined mountpoints and getty was there too. Yes I was redid your #4 steps, and weird thing is all mountpoints still intact on get mountpoints.


----------



## kpa (Oct 3, 2010)

I meant the command on post #6 but your mount points actually look fine because the altroot property is not a property of a dataset but the pool.

Can you see if there are any error messages in /altroot/var/log/messages or in any of /altroot/var/log/dmesg.*


----------



## Solaris (Oct 4, 2010)

kpa said:
			
		

> I meant the command on post #6 but your mount points actually look fine because the altroot property is not a property of a dataset but the pool.
> 
> Can you see if there are any error messages in /altroot/var/log/messages or in any of /altroot/var/log/dmesg.*



It went havoc, there was no files in var , it seem I forgot to set checksum=fletcher4 on zroot, after retrying from scratch all work fine, thanks kpa for the help .


----------



## danbi (Oct 8, 2010)

Just for the record, ZFS runs just fine with fletcher2, the default checksum algorithm. There is really no need to change it.


----------

