1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ZFS FreeBSD 8.2 RC3 - boots only in single user mode (manual mount of filesystems)

Discussion in 'General' started by margor, Feb 1, 2011.

  1. margor

    margor New Member

    Messages:
    10
    Thanks Received:
    0
    Hello,

    I installed FreeBSD 8.2-RC3 amd64 on my T61p without UFS (ZFS). It seems to me that OS cannot mount ZFS file systems during standard boot procedure. I can see lots of errors:
    Code:
    init: can't exec getty '/usr/libexec/getty' for port /dev/ttyvx

    where x is digit. I can easily reboot system by CTRL+ALT+DEL.

    If I boot in verbose mode I see that basic programs are not available:
    (sed not found, logger not found)

    If I choose single user mode there is no problem in mounting file systems.
    Code:
    # mount -u /
    # zfs mount -a
    # exit


    OS boots without any problem.

    I use GPT.

    /boot/loader.conf:
    Code:
    # ZFS
    zfs_load=YES
    vfs.root.mountfrom="zfs:tank"
    
    # WLAN
    if_iwn_load="YES"


    /etc/rc.conf:
    Code:
    zfs_load=YES
    hostname="t61p"
    moused_enable="YES"
    sendmail_enable="NONE"
    
    # WLANS
    wlans_iwn0="wlan0"
    ifconfig_wlan0="wpa DHCP"


    /etc/fstab:
    Code:
    proc /proc procfs rw 0 0
    /dev/ad4p2 none swap sw 0 0


    zpool config:
    Code:
    # zpool list
    NAME   SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
    tank    87G  1.44G  85.6G     1%  ONLINE  -
    
    # zfs list
    NAME            USED  AVAIL  REFER  MOUNTPOINT
    tank           1.44G  84.2G   290M  legacy
    tank/home      26.5K  84.2G  26.5K  /home
    tank/obj       4.67M  84.2G  4.67M  /usr/obj
    tank/ports      369M  84.2G   369M  /usr/ports
    tank/src        537M  84.2G   537M  /usr/src
    tank/tmp         23K  84.2G    23K  /tmp
    tank/usr        269M  84.2G   269M  /usr
    tank/usrlocal    18K  84.2G    18K  /usr/local
    tank/var        478K  84.2G   478K  /var


    disk config:
    Code:
    # gpart list
    Geom name: ad4
    state: OK
    fwheads: 16
    fwsectors: 63
    last: 195371534
    first: 34
    entries: 128
    scheme: GPT
    Providers:
    1. Name: ad4p1
       Mediasize: 65536 (64K)
       Sectorsize: 512
       Mode: r0w0e0
       rawuuid: c3f4a060-2d90-11e0-b00c-001e37cca61f
       rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
       label: (null)
       length: 65536
       offset: 17408
       type: freebsd-boot
       index: 1
       end: 161
       start: 34
    2. Name: ad4p2
       Mediasize: 6442450944 (6.0G)
       Sectorsize: 512
       Mode: r1w1e0
       rawuuid: cfd9d36f-2d90-11e0-b00c-001e37cca61f
       rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b


    I don't have idea how solve this problem. Did I forget about sth in loader.conf?
     
  2. margor

    margor New Member

    Messages:
    10
    Thanks Received:
    0
    I cannot edit post. I made mistake in gpart list:
    Code:
    Geom name: ad4
    state: OK
    fwheads: 16
    fwsectors: 63
    last: 195371534
    first: 34
    entries: 128
    scheme: GPT
    Providers:
    1. Name: ad4p1
       Mediasize: 65536 (64K)
       Sectorsize: 512
       Mode: r0w0e0
       rawuuid: c3f4a060-2d90-11e0-b00c-001e37cca61f
       rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
       label: (null)
       length: 65536
       offset: 17408
       type: freebsd-boot
       index: 1
       end: 161
       start: 34
    2. Name: ad4p2
       Mediasize: 6442450944 (6.0G)
       Sectorsize: 512
       Mode: r1w1e0
       rawuuid: cfd9d36f-2d90-11e0-b00c-001e37cca61f
       rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
       label: (null)
       length: 6442450944
       offset: 82944
       type: freebsd-swap
       index: 2
       end: 12583073
       start: 162
    3. Name: ad4p3
       Mediasize: 93587692032 (87G)
       Sectorsize: 512
       Mode: r1w1e1
       rawuuid: 13441203-2d91-11e0-b00c-001e37cca61f
       rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
       label: (null)
       length: 93587692032
       offset: 6442533888
       type: freebsd-zfs
       index: 3
       end: 195371534
       start: 12583074
    Consumers:
    1. Name: ad4
       Mediasize: 100030242816 (93G)
       Sectorsize: 512
       Mode: r2w2e3
     
  3. da1

    da1 Member

    Messages:
    759
    Thanks Received:
    64
    Hi,

    Pls use "code" tags for your code and paste the "dmesg".
     
  4. chrcol

    chrcol New Member

    Messages:
    347
    Thanks Received:
    9
    I also use gpt and on 8.2-rc3 for one server (upgraded yesterday), it boots fine.

    your first line in loader.conf looks off.

    shouldnt it be?

    Code:
    vfs.root.mountfrom="zfs:tank/root"
     
  5. kpa

    kpa Well-Known Member

    Messages:
    4,086
    Thanks Received:
    804
    Nothing wrong with the mountfrom parameter. As you can see from his # zfs list output there is no tank/root filesystem and he is using the root filesystem of the pool as /
     
  6. da1

    da1 Member

    Messages:
    759
    Thanks Received:
    64
    I had the same issue and I corrected it by adding the below line to /etc/fstab:
    Code:
    tank                   /                       zfs             rw      0       0
    
     
    margor thanks for this.
  7. margor

    margor New Member

    Messages:
    10
    Thanks Received:
    0
    Thanks for a clue.
    I modified /etc/fstab to:
    Code:
    proc /proc procfs rw 0 0
    /dev/ad4p2 none swap sw 0 0 
    tank/usr /usr zfs rw 0 0
    tank/ports /usr/ports zfs rw 0 0
    tank/src /usr/src zfs rw 0 0
    tank/home /home zfs rw 0 0
    tank/var /var zfs rw 0 0
    tank/usrlocal /usr/local zfs rw 0 0
    tank/obj /usr/obj zfs rw 0 0
    tank/tmp /tmp zfs rw 0 0
    


    Solved.
     
  8. da1

    da1 Member

    Messages:
    759
    Thanks Received:
    64
    Sorry to bust the whole joy state of trance but it's not really solved because:

    1. You shouldn't need to specify anything in /etc/fstab when you are using ZFS because it should be mounted automagically @ boot
    2. If you use this workaround (because this IS a workaround) you do not need to mount everything, just the "/" partition. Try it. The rest will mount automagically.

    I will return in a couple of hours, after I run some tests and update you guys.
     
  9. chrcol

    chrcol New Member

    Messages:
    347
    Thanks Received:
    9
    I am at a loss here, my VM boots fine on 8.2-PRERELEASE, and the server I updated last night boots fine on 8.2-RC3, I do not mount via fstab it is done with the loader.conf line. So baffling its done this to you guys. I am using GPT labels.
     
  10. usdmatt

    usdmatt Member

    Messages:
    566
    Thanks Received:
    94
    You have
    Code:
    zfs_load="YES"
    in /etc/rc.conf when it should be
    Code:
    zfs_enable="YES"


    I've never actually booted any ZFS system without this line but I believe ZFS filesystems will not be mounted without it (you have to add them to /etc/fstab as mentioned). I would still expect / to mount but it appears not.

    So simple fix, either correct /etc/rc.conf or add all zfs filesystems to /etc/fstab.
     
  11. margor

    margor New Member

    Messages:
    10
    Thanks Received:
    0
    With correct
    Code:
    zfs_enable="YES"
    works without /etc/fstab entries.
     
  12. chrcol

    chrcol New Member

    Messages:
    347
    Thanks Received:
    9
    I can confirm I have that line on all zfs systems. Good find.