FreeBSD 9.0 GPT RAID 1 mirror

Hi,

I have decided to try and do a RAID 1 mirror with the GPT. I was successful up until the reboot.

Steps that were taken:

Fresh install of FreeBSD 9.0

Code:
spider# gpart backup ada0 > ada0.gpt

spider# cat ada0.gpt
GPT 128
1   freebsd-boot        34       128  
2    freebsd-ufs       162 771751808  
3   freebsd-swap 771751970   8388608  

spider# gpart restore -F /dev/ada1 < ada0.gpt

spider# gpart show
=>       34  781422701  ada0  GPT  (372G)
         34        128     1  freebsd-boot  (64k)
        162  771751808     2  freebsd-ufs  (368G)
  771751970    8388608     3  freebsd-swap  (4.0G)
  780140578    1282157        - free -  (626M)
=>       34  781422701  ada1  GPT  (372G)
         34        128     1  freebsd-boot  (64k)
        162  771751808     2  freebsd-ufs  (368G)
  771751970    8388608     3  freebsd-swap  (4.0G)
  780140578    1282157        - free -  (626M)

spider# echo ‘geom_mirror_load=”YES”‘ >> /boot/loader.conf

spider# echo ‘kern.geom.debugflags=17‘ >> /etc/sysctl.conf

spider# echo ‘kern.geom.part.check_integrity=0‘ >> /etc/sysctl.conf

spider# shutdown -r now

Boot into single user mode.

Code:
# gmirror load
# gmirror label -vb round-robin p1 /dev/ada0p1
# gmirror label -vb round-robin p2 /dev/ada0p2
# gmirror label -vb round-robin p3 /dev/ada0p3
# mount /dev/mirror/p2 /mnt
# cd /mnt/etc
# cp fstab fstab.old
# ee fstab

Code:
# Device        Mountpoint      FStype  Options Dump    Pass#

/dev/mirror/ada0p2     /               ufs     rw      1       1
/dev/mirror/ada0p3     none            swap    sw      0       0

I then did gmirror status and waited till everything was 100% and complete.

I then did reboot

When the system rebooted I got this message on my screen:

mounting from ufs;/dev/mirror/ada0p2 failed with error 19

Picture can be seen here:

http://imgur.com/Oxzp7

So I did something wrong but have no idea where.


Sincerely,

Brendhan
 
Okay, I am not sure how it happened but somehow the /boot/loader.conf got erased.
I would not have believed it but I saw it happen twice.

I had to put the install disk in and let it go to a live cd.

At the prompt I mounted the hard drive. I change the fstab.

Code:
# mount /dev/ada0s1p2 /mnt
# ee /mnt/etc/fstab

Code:
# Device Mountpoint FStype Options Dump Pass#

/dev/mirror/ada0p2 / ufs rw 1 1
/dev/mirror/ada0p3 none swap sw 0 0

Now looks like

Code:
# Device Mountpoint FStype Options Dump Pass#

/dev/mirror/p2 / ufs rw 1 1
/dev/mirror/p3 none swap sw 0 0

I then went in and checked the loader.conf

Code:
#ee /mnt/boot/loader.conf

Code:
## Loader.conf file
geom_mirror_load=”YES”

I rebooted and it did the same thing with the error 19. I did the livecd again and saw that the loader.conf file was empty. I did it again and rebooted. This time it took.

So now things look to be working from what I can tell.

Code:
spider# gmirror status
     Name    Status  Components
mirror/p1  COMPLETE  ada0p1 (ACTIVE)
                     ada1p1 (ACTIVE)
mirror/p2  COMPLETE  ada0p2 (ACTIVE)
                     ada1p2 (ACTIVE)
mirror/p3  COMPLETE  ada0p3 (ACTIVE)
                     ada1p3 (ACTIVE)
spider#

So things are looking better.

Sincerely,

Brendhan
 
Understudy said:
Code:
spider# echo ‘kern.geom.debugflags=17‘ >> /etc/sysctl.conf
spider# echo ‘kern.geom.part.check_integrity=0‘ >> /etc/sysctl.conf

Permanently disabling the safety and telling the system to ignore corrupted and overlapping partitions is a mistake. Those features are there to protect your data.
 
wblock@ said:
Permanently disabling the safety and telling the system to ignore corrupted and overlapping partitions is a mistake. Those features are there to protect your data.

I will remove them and reboot. Thank you.

Sincerely,

Brendhan
 
Back
Top