Re: AHCI and ZFS: root mount error

2010-01-18 Thread Alexander Leidinger
Quoting Wes Morgan morg...@chemikals.org (from Sun, 17 Jan 2010  
09:04:16 -0600 (CST)):



On Sat, 16 Jan 2010, Volodymyr Kostyrko wrote:


On Sat, 16 Jan 2010 00:29:23 +0100
Oliver Brandmueller o...@e-gitt.net wrote:

 Check with zpool status if your zpool refers to diskslices like
 ad0s1. I use gpt have setup the ZFS mirror to refer to gptids:

   pool: silver
  state: ONLINE
  scrub: none requested
 config:

 NAMESTATE  
READ WRITE CKSUM
 silver  ONLINE 
   0 0 0
   mirrorONLINE 
   0 0 0
 gptid/9e68d234-f306-11de-a0c4-0002b3b6e838  ONLINE 
   0 0 0
 gptid/a025b88c-f306-11de-a0c4-0002b3b6e838  ONLINE 
   0 0 0


 With that kind of configuration I can switch back and forth between
 using ATA_CAM or using traditional ATA drivers. Since you're not using
 GPT I gues you can use geom labels to do more or less the same thing.

 In short: use labels, nut device names. Saves headaches in many cases.

ZFS actually can find disks without any glabel help. I have one server
which I have moved recently to ahci and nothing changes for me. ZFS
silently accepted new provider names and continue working as usual.



Agreed, I experienced the same thing here when I moved to AHCI. I think
pjd committed some changes in the last few months that greatly improved
the ability of zfs to find devices by uuid. Using glabel or gptid's
with zfs is highly overrated IMO!


Jumping into the discussion without much knowledge about the initial start...

If this is with 8-stable: the stuff is merged and should work.
If this is with 7-stable: the stuff is merged (by me) since 1-2 weeks.
If this is something else, have a look if the code as displayed at
  http://svn.freebsd.org/viewvc/base?view=revisionrevision=200158
is there (after this commit there is nothing else which affects
the ability to find devices).

What may work too is to export the zpool before switching and  
importing it again after switching the storage subsystem.


Bye,
Alexander.

--
Do you mean that you not only want a wrong
answer, but a certain wrong answer?
-- Tobaben

http://www.Leidinger.netAlexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org   netchild @ FreeBSD.org  : PGP ID = 72077137
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: AHCI and ZFS: root mount error

2010-01-17 Thread Wes Morgan
On Sat, 16 Jan 2010, Volodymyr Kostyrko wrote:

 On Sat, 16 Jan 2010 00:29:23 +0100
 Oliver Brandmueller o...@e-gitt.net wrote:

  Check with zpool status if your zpool refers to diskslices like
  ad0s1. I use gpt have setup the ZFS mirror to refer to gptids:
 
pool: silver
   state: ONLINE
   scrub: none requested
  config:
 
  NAMESTATE READ 
  WRITE CKSUM
  silver  ONLINE   0 
  0 0
mirrorONLINE   0 
  0 0
  gptid/9e68d234-f306-11de-a0c4-0002b3b6e838  ONLINE   0 
  0 0
  gptid/a025b88c-f306-11de-a0c4-0002b3b6e838  ONLINE   0 
  0 0
 
  With that kind of configuration I can switch back and forth between
  using ATA_CAM or using traditional ATA drivers. Since you're not using
  GPT I gues you can use geom labels to do more or less the same thing.
 
  In short: use labels, nut device names. Saves headaches in many cases.

 ZFS actually can find disks without any glabel help. I have one server
 which I have moved recently to ahci and nothing changes for me. ZFS
 silently accepted new provider names and continue working as usual.


Agreed, I experienced the same thing here when I moved to AHCI. I think
pjd committed some changes in the last few months that greatly improved
the ability of zfs to find devices by uuid. Using glabel or gptid's
with zfs is highly overrated IMO!
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: AHCI and ZFS: root mount error

2010-01-16 Thread Xin LI
On Fri, Jan 15, 2010 at 3:55 PM, Volodymyr Kostyrko c.kw...@gmail.com wrote:
 On Fri, 15 Jan 2010 21:13:39 +0100
 Romain Garbage romain.garb...@gmail.com wrote:

 After setting ahci_load=YES in /boot/loader.conf, I get a root mount error.
 ahci seems to attach to disk correctly (I get ada0 messages with no error)

 Without ahci_load=YES, system boots fine, with ata module attaching to 
 disk.

 I have a full zfs system, set up following wiki instructions:
 http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition
 (MBR scheme, ZFS in a FreeBSD slice, together with a swap partition)

 I'm using a GENERIC kernel, RELENG_8 branch.

 I have faced some problems that looks exactly like you say. I haven't 
 investigated thoroughly after some quick-hack-repairs machine runs flawlessly.

 1. I have moved to RELENG_8 from RELENG_8_0. I don't think this is it but 
 zfsloader support was what I was looking for.

 2. I reinitialised zfs partitions again with a boot code. But this time I 
 used bs=512 dd option.

 3. I recreated zpool.cache and replaced it on my pool.

I believe the step 3 has fixed your issue.

I believe that the zfs loader on -HEAD is less prone to this type of
problems, but I am not entirely sure if it would be helpful for
all-disk-name-changed case, though.

So, in conclusion, in order to fix the problem, one need:

Boot into an environment where you can mount ZFS partition.  With a
LiveFS boot, one can do this:

0) during boot, load zfs, tmpfs
1) mount a tmpfs on /boot/zfs
2) zpool import -f -R /mnt yourpool
3) set hostid to the one in your zpool, perhaps chroot into the zpool
and do hostid start
4) export and re-import zpool
5) overwrite /pool/boot/zfs with /boot/zfs
6) make sure the zfs has been written down to disk
7) reboot

(Steps 3-4 may be skipped in theory but I personally recommend one to do that).

Cheers,
-- 
Xin LI delp...@delphij.net http://www.delphij.net
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: AHCI and ZFS: root mount error

2010-01-15 Thread Oliver Brandmueller
Hi,

On Fri, Jan 15, 2010 at 09:13:39PM +0100, Romain Garbage wrote:
 After setting ahci_load=YES in /boot/loader.conf, I get a root mount error.
 ahci seems to attach to disk correctly (I get ada0 messages with no error)
 
 Without ahci_load=YES, system boots fine, with ata module attaching to disk.
 
 I have a full zfs system, set up following wiki instructions:
 http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition
 (MBR scheme, ZFS in a FreeBSD slice, together with a swap partition)
 
 I'm using a GENERIC kernel, RELENG_8 branch.
 
 My /boot/loader.conf:
 zfs_load=YES
 vfs.root.mountfrom=zfs:zroot
 nvidia_load=YES
 snd_hda_load=YES
 tmpfs_load=YES
 coretemp_load=YES

Check with zpool status if your zpool refers to diskslices like 
ad0s1. I use gpt have setup the ZFS mirror to refer to gptids:

  pool: silver
 state: ONLINE
 scrub: none requested
config:

NAMESTATE READ WRITE 
CKSUM
silver  ONLINE   0 0
 0
  mirrorONLINE   0 0
 0
gptid/9e68d234-f306-11de-a0c4-0002b3b6e838  ONLINE   0 0
 0
gptid/a025b88c-f306-11de-a0c4-0002b3b6e838  ONLINE   0 0
 0

With that kind of configuration I can switch back and forth between 
using ATA_CAM or using traditional ATA drivers. Since you're not using 
GPT I gues you can use geom labels to do more or less the same thing.

In short: use labels, nut device names. Saves headaches in many cases.


- Olli


-- 
| Oliver Brandmueller  http://sysadm.in/ o...@sysadm.in |
|Ich bin das Internet. Sowahr ich Gott helfe. |
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: AHCI and ZFS: root mount error

2010-01-15 Thread Volodymyr Kostyrko
On Sat, 16 Jan 2010 00:29:23 +0100
Oliver Brandmueller o...@e-gitt.net wrote:

 Check with zpool status if your zpool refers to diskslices like 
 ad0s1. I use gpt have setup the ZFS mirror to refer to gptids:
 
   pool: silver
  state: ONLINE
  scrub: none requested
 config:
 
 NAMESTATE READ WRITE 
 CKSUM
 silver  ONLINE   0 0  
0
   mirrorONLINE   0 0  
0
 gptid/9e68d234-f306-11de-a0c4-0002b3b6e838  ONLINE   0 0  
0
 gptid/a025b88c-f306-11de-a0c4-0002b3b6e838  ONLINE   0 0  
0
 
 With that kind of configuration I can switch back and forth between 
 using ATA_CAM or using traditional ATA drivers. Since you're not using 
 GPT I gues you can use geom labels to do more or less the same thing.
 
 In short: use labels, nut device names. Saves headaches in many cases.

ZFS actually can find disks without any glabel help. I have one server which I 
have moved recently to ahci and nothing changes for me. ZFS silently accepted 
new provider names and continue working as usual.

-- 
Sphinx of black quartz judge my vow.


___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: AHCI and ZFS: root mount error

2010-01-15 Thread Volodymyr Kostyrko
On Fri, 15 Jan 2010 21:13:39 +0100
Romain Garbage romain.garb...@gmail.com wrote:

 After setting ahci_load=YES in /boot/loader.conf, I get a root mount error.
 ahci seems to attach to disk correctly (I get ada0 messages with no error)
 
 Without ahci_load=YES, system boots fine, with ata module attaching to disk.
 
 I have a full zfs system, set up following wiki instructions:
 http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition
 (MBR scheme, ZFS in a FreeBSD slice, together with a swap partition)
 
 I'm using a GENERIC kernel, RELENG_8 branch.

I have faced some problems that looks exactly like you say. I haven't 
investigated thoroughly after some quick-hack-repairs machine runs flawlessly.

1. I have moved to RELENG_8 from RELENG_8_0. I don't think this is it but 
zfsloader support was what I was looking for.

2. I reinitialised zfs partitions again with a boot code. But this time I used 
bs=512 dd option.

3. I recreated zpool.cache and replaced it on my pool.

Actually I don't know which one helped me, but my bet is for the third step and 
maybe for second.

-- 
Sphinx of black quartz judge my vow.


___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: AHCI and ZFS: root mount error

2010-01-15 Thread Romain Garbage
2010/1/16, Volodymyr Kostyrko c.kw...@gmail.com:
 On Fri, 15 Jan 2010 21:13:39 +0100
 Romain Garbage romain.garb...@gmail.com wrote:

 After setting ahci_load=YES in /boot/loader.conf, I get a root mount
 error.
 ahci seems to attach to disk correctly (I get ada0 messages with no error)

 Without ahci_load=YES, system boots fine, with ata module attaching to
 disk.

 I have a full zfs system, set up following wiki instructions:
 http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition
 (MBR scheme, ZFS in a FreeBSD slice, together with a swap partition)

 I'm using a GENERIC kernel, RELENG_8 branch.

 I have faced some problems that looks exactly like you say. I haven't
 investigated thoroughly after some quick-hack-repairs machine runs
 flawlessly.

 1. I have moved to RELENG_8 from RELENG_8_0. I don't think this is it but
 zfsloader support was what I was looking for.

 2. I reinitialised zfs partitions again with a boot code. But this time I
 used bs=512 dd option.

 3. I recreated zpool.cache and replaced it on my pool.

 Actually I don't know which one helped me, but my bet is for the third step
 and maybe for second.

A weird thing:

I just built and installed a new kernel (RELENG_8, source csuped a few
hours ago), just adding device ahci to the config file. I get the
same error, with driver attaching correctly.

Now, adding ahci_load=NO to /boot/loader.conf and booting the new
custom kernel, it just boots fine, ahci attaching to the device, and
zfs root gets mounted.

dmesg | grep ada

ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: ST9250320AS 0303 ATA-8 SATA 2.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)cd0
at ahcich1 bus 0 scbus1 target 0 lun 0
ada0: Command Queueing enabled
ada0: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C)
ada1 at ahcich2 bus 0 scbus2 target 0 lun 0
ada1: SAMSUNG HM500JI 2AC101C4 ATA-8 SATA 2.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)
ada1: Command Queueing enabled
ada1: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: ST9250320AS 0303 ATA-8 SATA 2.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)cd0
at ahcich1 bus 0 scbus1 target 0 lun 0
ada0: Command Queueing enabled
ada0: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C)
ada1 at ahcich2 bus 0 scbus2 target 0 lun 0
ada1: SAMSUNG HM500JI 2AC101C4 ATA-8 SATA 2.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)
ada1: Command Queueing enabled
ada1: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)

I didn't do anything else, just the line in loader.conf, and the
system just works fine.

Romain
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: AHCI and ZFS: root mount error

2010-01-15 Thread Jeremy Chadwick
On Sat, Jan 16, 2010 at 01:48:12AM +0100, Romain Garbage wrote:
 2010/1/16, Volodymyr Kostyrko c.kw...@gmail.com:
  On Fri, 15 Jan 2010 21:13:39 +0100
  Romain Garbage romain.garb...@gmail.com wrote:
 
  After setting ahci_load=YES in /boot/loader.conf, I get a root mount
  error.
  ahci seems to attach to disk correctly (I get ada0 messages with no error)
 
  Without ahci_load=YES, system boots fine, with ata module attaching to
  disk.
 
  I have a full zfs system, set up following wiki instructions:
  http://wiki.freebsd.org/RootOnZFS/ZFSBootPartition
  (MBR scheme, ZFS in a FreeBSD slice, together with a swap partition)
 
  I'm using a GENERIC kernel, RELENG_8 branch.
 
  I have faced some problems that looks exactly like you say. I haven't
  investigated thoroughly after some quick-hack-repairs machine runs
  flawlessly.
 
  1. I have moved to RELENG_8 from RELENG_8_0. I don't think this is it but
  zfsloader support was what I was looking for.
 
  2. I reinitialised zfs partitions again with a boot code. But this time I
  used bs=512 dd option.
 
  3. I recreated zpool.cache and replaced it on my pool.
 
  Actually I don't know which one helped me, but my bet is for the third step
  and maybe for second.
 
 A weird thing:
 
 I just built and installed a new kernel (RELENG_8, source csuped a few
 hours ago), just adding device ahci to the config file. I get the
 same error, with driver attaching correctly.
 
 Now, adding ahci_load=NO to /boot/loader.conf and booting the new
 custom kernel, it just boots fine, ahci attaching to the device, and
 zfs root gets mounted.
 
 dmesg | grep ada
 
 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
 ada0: ST9250320AS 0303 ATA-8 SATA 2.x device
 ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)cd0
 at ahcich1 bus 0 scbus1 target 0 lun 0
 ada0: Command Queueing enabled
 ada0: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C)
 ada1 at ahcich2 bus 0 scbus2 target 0 lun 0
 ada1: SAMSUNG HM500JI 2AC101C4 ATA-8 SATA 2.x device
 ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)
 ada1: Command Queueing enabled
 ada1: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
 ada0: ST9250320AS 0303 ATA-8 SATA 2.x device
 ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)cd0
 at ahcich1 bus 0 scbus1 target 0 lun 0
 ada0: Command Queueing enabled
 ada0: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C)
 ada1 at ahcich2 bus 0 scbus2 target 0 lun 0
 ada1: SAMSUNG HM500JI 2AC101C4 ATA-8 SATA 2.x device
 ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO size 8192bytes)
 ada1: Command Queueing enabled
 ada1: 476940MB (976773168 512 byte sectors: 16H 63S/T 16383C)
 
 I didn't do anything else, just the line in loader.conf, and the
 system just works fine.

Can you post your entire kernel configuration file?  Thanks.

-- 
| Jeremy Chadwick   j...@parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: AHCI and ZFS: root mount error

2010-01-15 Thread Romain Garbage
2010/1/16, Jeremy Chadwick free...@jdc.parodius.com:

 Can you post your entire kernel configuration file?  Thanks.

Here it its:
I just copied the GENERIC conf file, commented out device ataraid and
device atadisk, added option ATA_CAM (I forgot to mention all that
stuff it in last post), and added device ahci.

#
# GENERIC -- Generic kernel configuration file for FreeBSD/amd64
#
# For more information on this file, please read the config(5) manual page,
# and/or the handbook section on Kernel Configuration Files:
#
#
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ../../conf/NOTES and NOTES files.
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.531.2.7 2010/01/12 06:00:56
brooks Exp $

cpu HAMMER
ident   ATACAMKERNEL

# To statically compile in device wiring instead of /boot/device.hints
#hints  GENERIC.hints # Default places to look for devices.

# Use the following to compile in values accessible to the kernel
# through getenv() (or kenv(1) in userland). The format of the file
# is 'variable=value', see kenv(1)
#
# env   GENERIC.env

makeoptions DEBUG=-g# Build kernel with gdb(1) debug symbols

options SCHED_ULE   # ULE scheduler
options PREEMPTION  # Enable kernel thread preemption
options INET# InterNETworking
options INET6   # IPv6 communications protocols
options SCTP# Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists
options UFS_DIRHASH # Improve performance on big directories
options UFS_GJOURNAL# Enable gjournal-based UFS journaling
options MD_ROOT # MD is a potential root device
options NFSCLIENT   # Network Filesystem Client
options NFSSERVER   # Network Filesystem Server
options NFSLOCKD# Network Lock Manager
options NFS_ROOT# NFS usable as /, requires NFSCLIENT
options MSDOSFS # MSDOS Filesystem
options CD9660  # ISO 9660 Filesystem
options PROCFS  # Process filesystem (requires PSEUDOFS)
options PSEUDOFS# Pseudo-filesystem framework
options GEOM_PART_GPT   # GUID Partition Tables.
options GEOM_LABEL  # Provides labelization
options COMPAT_43TTY# BSD 4.3 TTY compat (sgtty)
options COMPAT_IA32 # Compatible with i386 binaries
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options COMPAT_FREEBSD6 # Compatible with FreeBSD6
options COMPAT_FREEBSD7 # Compatible with FreeBSD7
options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI
options KTRACE  # ktrace(1) support
options STACK   # stack(9) support
options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
options P1003_1B_SEMAPHORES # POSIX-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time
extensions
options PRINTF_BUFR_SIZE=128# Prevent printf output being
interspersed.
options KBD_INSTALL_CDEV# install a CDEV entry in /dev
options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)
options AUDIT   # Security event auditing
options MAC # TrustedBSD MAC Framework
options FLOWTABLE   # per-cpu routing cache
#optionsKDTRACE_FRAME   # Ensure frames are compiled in
#optionsKDTRACE_HOOKS   # Kernel DTrace hooks
options ATA_CAM

# Make an SMP-capable kernel by default
options SMP # Symmetric MultiProcessor Kernel

# CPU frequency control
device  cpufreq

# Bus support.
device  acpi
device  pci

# Floppy drives
device  fdc

# ATA and ATAPI devices
device  ata
#device atadisk # ATA disk drives