# FreeBSD 10 failed installing on ZFS-Root



## Engraf (Feb 21, 2014)

When I choose 'Automatic Root-on-ZFS' and then 'Proceed with Installation' on 'Partitioning' screen of bsdinstall I got this error:

```
gpart: start '792': No space left on device
```
What's wrong?


----------



## SirDice (Feb 21, 2014)

I thought the message was quite clear actually, "No space left on device". Or in layman's terms, it doesn't fit.


----------



## Engraf (Feb 21, 2014)

Disk if fully cleared (gpart destroy'ed). What have I to do it become fit?
The bsdinstaller does not do it automatically?


----------



## SirDice (Feb 21, 2014)

How big is the disk? And tell us exactly what you did during install. I haven't used the 10.0 installer yet but it should be able to automatically partition the disk correctly provided there's enough room.


----------



## Engraf (Feb 21, 2014)

Disk is 137Gb RAID1 on HP SmartArray. (Default installation on UFS passes normal)
Оn 'Partitioning' screen I choose 'ZFS - 'Automatic Root-on-ZFS'.
With no changing anything in ZFS options
(Pool Name: zroot
Force 4K Sectors?: Yes
Encrypt Disks?: No
Partition Scheme: GPT
Swap Size: 2g),
I further choose 'Install - Proceed with instalation'. In 'Select Virtual Device Type' I choose 'Stripe - No Redundancy'. Then choose only drive (da0) and press OK, confirm operation on warning about destroying content of disk. Installer thinks for a few seconds, types in console this:
	
	



```
ZFS NOTICE: Prefetch is disabled by default if less than 4GB of RAM is present;
		to enable, add "vfs.zfs.prefetch_disable=0" to /boot/loader.conf .
ZFS filesystem version: 5
ZFS storage pool version: features support (5000)
```
 and then shows the above error.

P.S.  Before I retry installation, I make 'gpart destroy ad0' and then reboot


----------



## SirDice (Feb 21, 2014)

If you want to use ZFS it's best not to use the RAID functionality of the controller. ZFS works best if it has direct access to the disks themselves.


----------



## Engraf (Feb 21, 2014)

Unfortunately, machine may boot only from raid... (BL460c G1)


----------



## trh411 (Feb 21, 2014)

Engraf said:
			
		

> When I choose 'Automatic Root-on-ZFS' and then 'Proceed with Installation' on 'Partitioning' screen of bsdinstall I got this error:
> 
> ```
> gpart: start '792': No space left on device
> ...


I would be real curious to see the output of `gpart show da0` right after you get that error. Can you post it, please?


----------



## Engraf (Feb 21, 2014)

`gpart show da0`

```
=>    34        286677053      da0      GPT    (137G)
      34              758             - free -  (379K)
     792             1024        1     freebsd-boot  (512K)
    1816        286675271             - free -  (137G)
```


----------



## Engraf (Feb 24, 2014)

I've tried to follow this instruction: https://wiki.freebsd.org/RootOnZFS/GPTZFSBoot/9.0-RELEASE
On command `gpart add -s 222 -a 4k -t freebsd-boot -l boot0 da0` I've got following message:
	
	



```
da0p1 added, but partition is not aligned on 1048576
```
It seems to me that hardware RAID prevents 4K fitting...


----------



## Engraf (Feb 24, 2014)

Additionally, I've tried to retry `gpart add` command with various -a option, and it's passed without warnings only with -a equal to at least 4096K (I used the value of a multiple of 4K).


----------



## timp (Jan 30, 2015)

Engraf said:


> When I choose 'Automatic Root-on-ZFS' and then 'Proceed with Installation' on 'Partitioning' screen of bsdinstall I got this error:
> 
> ```
> gpart: start '792': No space left on device
> ...


Looks like it's gpart(8) can't auto calculate the start normally.

What I did:
boot from cd (usb stick)
select 'Shell'
`# cp -r /usr/libexec/bsdinstall /tmp/
# sed -i '' -e 's/gpart add /gpart add -a 4k /' /tmp/bsdinstall/zfsboot
# mount_unionfs /tmp/bsdinstall /usr/libexec/bsdinstall
# exit`
Then install as usually.


----------



## dteske@ (Feb 3, 2015)

Engraf said:


> When I choose 'Automatic Root-on-ZFS' and then 'Proceed with Installation' on 'Partitioning' screen of bsdinstall I got this error:
> 
> ```
> gpart: start '792': No space left on device
> ...



When the installer is performing its tasks, it keeps a running debug log at /tmp/bsdinstall_log

If you can press Alt+F4 after the error appears, try to get /tmp/bsdinstall_log copied over to a) some storage on the network (e.g., use `dhclient <interface>` to bring up networking and then use scp(1)) or b) some empty space on the thumb drive.

That file (/tmp/bsdinstall_log) has lots of information that we can use to diagnose the underlying issue.


----------



## petrek (Feb 5, 2015)

It seems that bsdinstall is buggy, and can't handle the 4K option at all:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195174
As far as I remember changing zfsboot helped me not, but hopefully you will be more lucky than me. The only other option I've found so far is to turn off 4K forcing.


----------



## timp (Feb 10, 2015)

dteske@ said:


> When the installer is performing its tasks, it keeps a running debug log at /tmp/bsdinstall_log
> 
> If you can press Alt+F4 after the error appears, try to get /tmp/bsdinstall_log copied over to a) some storage on the network (e.g., use `dhclient <interface>` to bring up networking and then use scp(1)) or b) some empty space on the thumb drive.
> 
> That file (/tmp/bsdinstall_log) has lots of information that we can use to diagnose the underlying issue.


Hi, dteske@!
I know that, but bsdinstall_log doesn't contain anything interesting.
Here is log from FreeBSD 10.1 RELEASE amd64 - https://yadi.sk/d/MJU10-l2eaLcd
And I tried ISO that you suggested, made of 10.1 STABLE - https://yadi.sk/d/9nEgHsmaeaLhN.
Same message.

So, gpart is wrong?


----------



## timp (Feb 24, 2015)

Hi! In my opinion:

```
gpart: start '792': No space left on device"
```
is about gpart(8) problem.
I created a new PR https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197989


petrek said:


> It seems that bsdinstall is buggy, and can't handle the 4K option at all:
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195174
> As far as I remember changing zfsboot helped me not, but hopefully you will be more lucky than me. The only other option I've found so far is to turn off 4K forcing.


bsdinstall handles 4k option only regarding to filesystem block size. It used gnop for that, but now it uses sysctl vfs.zfs.min_auto_ashift.
bsdinstall doesn't handle partition alignment to 4k at all now. But it should.


----------

