Archive for the 'Uncategorized' Category

在一顆硬碟上同時作 gmirror 與 ZFS

情形:有兩顆同樣大小的硬碟,想切出 10G 當 / 並作 gmirror,其他作 ZFS。

作法:先灌好 FreeBSD,把硬碟切成同一個 partition,例如說 ad0s1。 / 放在 ad0s1a,swap 放在 ad0s1b,ZFS 放在 ad0s1d。假設另一顆硬碟是 ad1,也同樣切成 a,b,d 三個與 ad0 slice 大小相同的 slice。

# gmirror load
# gmirror label -v -h -b round-robin gm0s1a ad1s1a
# newfs -U -O2 /dev/mirror/gm0s1a
# mount -o noatime /dev/mirror/gm0s1a /mnt
# echo ‘geom_mirror_load="YES"’ >> /boot/loader.conf
# vi /etc/fstab

把 /dev/ad0s1a 都改成 /dev/mirror/gm0s1a

# cd /
# tar -c –one-file-system -f - . | tar xpf - -C /mnt/

重開後,再把 ad0s1a insert 回去:

# gmirror insert gm0s1a ad0s1a
# gmirror rebuild gm0s1a ad0s1a

接著建立 ZFS:

# zpool create tank ad0s1d ad1s1d

這樣就完成了。

英文每日一句

14:29 < @j> 原來 miss the boat 意思是”錯失良機”…
14:30 < @l> nice boat 就是 “大好機會”
14:30 < @g> XD

新年快樂

回鄉祭祖
IMG_1109

貼春聯
IMG_1137

過門而不入的夢時代
IMG_1144.jpg

古拉爵的生火腿…orz
IMG_1147.jpg

最小的堂妹
IMG_1164

高雄火車站一景
IMG_1170

高鐵
IMG_1177.jpg

改用 wordpress…

雖然很少寫 blog, 但是每次要寫的時候 wretch 就當掉 -________-

現在要轉移過來又當一次…

改天再轉吧 Q_Q