# Mirroring ahci drives



## serverhamster (May 20, 2011)

I want to mirror 2 SSD drives. Yesterday I managed to convert my system to ahci, so instead of /dev/ad4 and /dev/ad6 the drives are now /dev/ada0 and /dev/ada1.

So, I followed the handbook, but substituted the device name:`#  gmirror label -vb round-robin gm0 /dev/ada0`
Likewise, I substituted ada0 with gm0 in /etc/fstab.

Unfortunately, the system will not boot. My root device was /dev/ada0p2 and (if I'm correct) should now be /dev/gm0p2. It appears I'm wrong, but what should the root device be?


```
mountroot> ?
List of GEOM managed disk devices:
  mirror/gm0 ada1 ada0 da5 da4 da3 da2 da1 acd0
Loader variables:
vfs.root.mountfrom=ufs:/dev/mirror/gm0p2
vfs.root.mountfrom.options=rw
```


----------



## da1 (May 20, 2011)

Did you try booting /dev/mirror/gm0 too? If this doesn't work, you can drop to single user mode and examen the mirror [cmd=""]ls /dev/mirror/*[/cmd] to see what's there.

PS: Did you set the kern.geom.debugflags before creating the mirror? Was the metadata successfully stored to ada0?
Do you have 
	
	



```
geom_mirror_load="YES"
```
 in your /boot/loader.conf?

My knowledge about SSDs is limited but could the 4k sectors (alignment) have anything to do with this? Some more experienced user can debate this.


----------



## serverhamster (May 24, 2011)

No, I messed up. The instructions in the handbook are not meant for ahci. There is a thread about it here: http://docs.freebsd.org/cgi/mid.cgi?20110104170611.GA67159

I eventually decided AHCI+GPT+gmirror is too complex for a FreeBSD beginner like me, so I kept GPT+AHCI, made a ZFS mirror and restored the ufs dump on it. It's working fine.

```
# gpart show
=>       34  187557485  ada0  GPT  (89G)
         34        128     1  freebsd-boot  (64k)
        162       1886        - free -  (943k)
       2048    8388608     2  freebsd-swap  (4.0G)
    8390656  179166863     3  freebsd-zfs  (85G)

=>       34  187557485  ada1  GPT  (89G)
         34        128     1  freebsd-boot  (64k)
        162       1886        - free -  (943k)
       2048    8388608     2  freebsd-swap  (4.0G)
    8390656  179166863     3  freebsd-zfs  (85G)
```
I only forgot to take the 4k sectors into account when creating the zpool, so that will have to be redone as soon as I figure out how to take dump-like backups with *zfs send/receive*. It's very clear to me now why people around here ask for a new installer.


----------

