Блог компании ServerClub

Установка freebsd 10 на zfs зеркало из двух дисков - новости - ServerСlub

10 октября 2014 г. Просмотров: 6357 RSS 23 , , ,

Не более чем заметка, дабы вновь не писать.

Оговориться стоит лишь о том, что в моем случае на сервере только 2Гб ОЗУ и для этого добавлено vfs.zfs.prefetch_disable=0 в loader.conf

Итак, скрипт:

sysctl kern.geom.debugflags=0x10
kldload zfs
gpart destroy -F /dev/ada0
gpart destroy -F /dev/ada1
gpart create -s GPT /dev/ada0
gpart create -s GPT /dev/ada1
gpart add -b 34 -s 64k -t freebsd-boot /dev/ada0
gpart add -s 4G -t freebsd-swap -l swap0 ada0
gpart add -b 34 -s 64k -t freebsd-boot /dev/ada1
gpart add -s 4G -t freebsd-swap -l swap1 ada1
gpart add -t freebsd-zfs -l disk0 /dev/ada0
gpart add -t freebsd-zfs -l disk1 /dev/ada1
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 /dev/ada0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 /dev/ada1
zpool create -m /mnt zroot mirror /dev/gpt/disk0 /dev/gpt/disk1 
zfs set checksum=fletcher4 zroot
zfs set atime=off zroot
zpool set bootfs=zroot zroot
zfs set mountpoint=/mnt zroot
zpool export zroot
zpool import -o cachefile=/tmp/zpool.cache zroot
zfs create zroot/usr
zfs create zroot/usr/home
zfs create zroot/var
zfs create -o compression=on -o exec=on -o setuid=off zroot/tmp
zfs create -o compression=lzjb -o setuid=off zroot/usr/ports
zfs create -o compression=off -o exec=off -o setuid=off zroot/usr/ports/distfiles
zfs create -o compression=off -o exec=off -o setuid=off zroot/usr/ports/packages
zfs create -o compression=lzjb -o exec=off -o setuid=off zroot/usr/src
zfs create -o compression=lzjb -o exec=off -o setuid=off zroot/var/crash
zfs create -o exec=off -o setuid=off zroot/var/db
zfs create -o compression=lzjb -o exec=on -o setuid=off zroot/var/db/pkg
zfs create -o exec=off -o setuid=off zroot/var/empty
zfs create -o compression=lzjb -o exec=off -o setuid=off zroot/var/log
zfs create -o compression=gzip -o exec=off -o setuid=off zroot/var/mail
zfs create -o exec=off -o setuid=off zroot/var/run
zfs create -o compression=lzjb -o exec=on -o setuid=off zroot/var/tmp
swapon /dev/gpt/swap0
swapon /dev/gpt/swap1
chmod 1777 /mnt/tmp
chmod 1777 /mnt/var/tmp
cd /mnt ; ln -s usr/home home
echo "install ..."
sleep 1
mkdir /usr/freebsd-dist
cd /usr/freebsd-dist
cat base.txz | tar --unlink -xvpJf - -C /mnt
cat kernel.txz | tar --unlink -xvpJf - -C /mnt
cat src.txz | tar --unlink -xvpJf - -C /mnt
echo "install ok"
sleep 1
cp /tmp/zpool.cache /mnt/boot/zfs/zpool.cache
echo 'zfs_enable="YES"' >> /mnt/etc/rc.conf
echo 'zfs_load="YES"' >> /mnt/boot/loader.conf
echo 'vfs.root.mountfrom="zfs:zroot"' >> /mnt/boot/loader.conf
echo "vfs.zfs.prefetch_disable=0" >> /boot/loader.conf 
echo '#vm.kmem_size="512M"' >> /mnt/boot/loader.conf
echo "# Device                       Mountpoint              FStype  Options         Dump    Pass#" > /mnt/etc/fstab
echo "/dev/gpt/swap0                 none                    swap    sw              0       0" >>/mnt/etc/fstab
echo "/dev/gpt/swap1                 none                    swap    sw              0       0" >>/mnt/etc/fstab
zfs set readonly=on zroot/var/empty
zfs umount -a
zfs set mountpoint=legacy zroot
zfs set mountpoint=/tmp zroot/tmp
zfs set mountpoint=/usr zroot/usr
zfs set mountpoint=/var zroot/var

Затем заходим в свежеустановленную ОС правим rc.conf должным образом, настраиваем ssh*, пользователей и т.д.


ключей ssh не генерирует, делаем сами

ssh-keygen -t rsa -f /etc/ssh/ssh_rsa_key -N ''
ssh-keygen -t dsa -f /etc/ssh/ssh_dsa_key -N ''
Комментариев: 23
  1. Соберем для Вас по интернет клиентские базы данных для Вашего Бизнеса Узнайте подробнее по Email: Тел +79139230330(wiber/whatsapp/telegram) Skype: prodawez390

  2. Кстати, а кто-нибудь слышал про инвест проект - [url=][/url] ?

  3. papildai sportui

  4. Cialis Viagra Torino Pharmacy Express Reviews [url=]cialis[/url] Protonix Levitra 75 Mg Viagra Definition Cialis Gratuit [url=]cialis[/url] Propecia Dhea 5 Alpha Reductase Baclofene Cp [url=]cialis[/url] Viagra Generique Cialis Vardenafil Drug Information Free Shipping Acticin Where To Buy Overseas Next Day Acquistare Sildenafil Francia Viagra Pfizer Tabletten [url=]propecia meilleur prix[/url] Viagra En Vente Manjishtha Take Viagra Soft Tabs isotretinoin claravis Carmarthenshire [url=]generic cialis[/url] Cialis Effet Viagra E Sclerosi Multipla Tretinoin Without A Prescription Canada Whats Does Keflex Do Clomid Et Utrogestan Viagra Donde Lo Consigo [url=]viagra prescription[/url] Brand Cialis Non Prescription Needed Whoesale Levitra Pills Cialis Doses Purchasing Generic Stendra On Line Cialis Et Consommation D'Alcool [url=]cheap levitra for sale[/url] Levitra 10mg 20mg Can i purchase isotretinoin 10mg website cheap Canadian Viagara Salbutamol Nebules Buy [url=]Buy Viagra[/url] Levitra Generique Ligne Cialis Generico En Barcelona Mail Order Drug Store In Belize Clomid For Sale Visa Payment In Uk Propecia Decadencia De Pelo [url=]Cheap Cialis[/url] Venta De Viagra Priligy Doesn'T Work Order Propecia Non Prescription [url=]viagra[/url] Quanto Costa Il Viagra Da 100 Mg Clobetasol Vitiligo Usa Medicine Online With Free Shipping Cialis Pas Cher Pharmacie Paris Ordering Keflex Kamagra Dapoxetine Pfizer Official Tadalis Sx Soft [url=]viagra[/url] Mdm And Amoxicillin Viagra Senior Amoxicillin And Prednisolone [url=]viagra cialis[/url] Levitra Acheter Amoxicillin And Clavulante Potassium Tablets Propecia With Rogaine Propecia To Treat Gynecomastia [url=]cialis[/url] Propecia Recuperarelpelo Cheapest Levitra Online Uk [url=]cialis online[/url] Where Can I Purchase Cialis Pills Propecia Arginina Amoxicillin Yeast Infection Viagra Usa Pharmacy Levitra Orosolubile Bayer Prezzo [url=]Buy Viagra[/url] Buy Amantadine Keflex Antibiotic For Spider Bites Propecia Brust [url=]buy viagra[/url] Amoxicillin Sale Acticin With Next Day Delivery Zithromax For Copd [url=]Buy Viagra[/url] Online Secure Bentyl Free Consultation

  5. Polecam moją strone: [url=]szybkie pożyczki przez internet bez zaświadczeń[/url]

  6. Sleep apnea is a very difficult thing to live with, both for the sufferer and for people living and sleep with him or her. If you fit into either of these categories, then you know just how frustrating it can be. Read through the tips found in this article to learn the best way to survive this problem!

    You really need to do your best to lose weight if you have sleep apnea. Those who have sleep apnea typically have a neck circumference of 17 inches or more. This excess weight around the throat causes the airway to collapse more easily during sleep. Reducing your weight by even ten pounds can have a beneficial impact on your sleep apnea.

    Adjust your CPAP machine. Most machines come with default settings that might not correspond to your needs. You should be able to regulate the airflow: try different settings and choose one that seems to work for you. If you feel like your machine is not working like it should, try changing the settings again.

    Avoid drinking alcohol to excess. Your muscles are relaxed by drinking alcohol. You may want to feel more relaxed, but it can exacerbate your apnea. When your throat muscles relax, your airway narrows and causes sleep apnea. If you're not going to give up alcohol, then just don't do it right before bedtime.

    Try your best to lay off tobacco and nicotine products. Cigarette smoke can irritate your upper airway causing it to swell up, subsequently hindering your ability to breath during the night. Quitting smoking could therefore, significantly improve your sleep apnea symptoms and will also improve your body's overall health and your feelings of well-being.

    Check if a corrective device can help alleviate your sleep apnea symptoms. Having an overbite, an undersized jaw or a recessed chin can cause your airway to be more narrow because of how your jawbone is set. These devices help create proper alignment of your jaw while you sleep, opening up your airway more. As a result, you experience fewer sleep apnea symptoms.

    Weight loss can be a big help for those that suffer from sleep apnea. The condition is common in overweight patients that have larger neck circumferences. Losing weight can significantly reduce the pressure on your airway and improve the flow of air as you breathe at night.

    If you have difficulties sleeping because of your sleep apnea, you should avoid driving or operating dangerous machines. If you do not get a good night of sleep, take public transportation instead of driving to prevent accidents and do not take a job in a factory or on a construction site.

    If you are a trucker who has sleep apnea, take precautions to stay safe on the road. First of all, get yourself properly diagnosed and treated. If your doctor prescribes a CPAP, use it. They are small and easily portable and can run on battery power if necessary. Try to stay fit and get regular sleep to keep your condition under control.

    These tips were written especially for people who suffer from apnea, whether directly or indirectly as a bed partner. While it can be quite difficult to completely remove apnea from your life, there are ways to live with it, and these were touched on in this useful sleep apnea article.


  7. vmatterw cletq [url=]where buy cialis online[/url] tknewe

  8. velsei is there a generic cialis order cialis

    buy generic cialis book

    [url=]buy cialis[/url]

  9. norsk kasino [url=]norsk kasino[/url]

  10. Attention Required! | Cloudflare

    [url=]Click here>>>[/url]

  11. If you have a desire to learn how to earn from $ 500 per day and work only for yourself, then write to us at email:

  12. 301 Moved Permanently

    [url=]Click here![/url]

  13. hs055gqjjft3101vwq




  14. Hot sale! E-gift card amazon with a face value of $ 2000 for only $ 500.

    The promotion will last until July 31, 2017. After July 31, the price will be $ 1000

  15. pay day loans

    [url=]loans for bad credit [/url]

    <a href="">quick loans </a>

  16. topuw97w3z buying viagra online - cheap viagra online - [url=]online pharmacy viagra[/url] - <a href=""> buy viagra online</a> - viagra online prescription free

  17. topba90y8i buying viagra online - buy viagra online - [url=]order viagra online[/url] - <a href=""> viagra online</a> - cheap viagra online canadian pharmacy

  18. topad32a0h viagra online usa - viagra online canadian pharmacy - [url=]order viagra online[/url] - <a href=""> generic viagra online</a> - real viagra online

  19. topae53x4e buy real viagra online - buy generic viagra online - [url=]online pharmacy viagra[/url] - <a href=""> online viagra</a> - online viagra reviews

  20. topng60c8r buy real viagra online - online pharmacy viagra - [url=]online pharmacy viagra[/url] - <a href=""> online pharmacy viagra</a> - viagra prescription online

  21. toptb28w2l

    best male enhancement pills over the counter

    male enhancement reviews

    <a href=""> extenze male enhancement</a>

    [url=]extenze male enhancement[/url]

    male enhancement pills reviews

  22. [url=]cialis canadian pharmacy [/url]

    viagra online canadian pharmacy

    real canadian pharmacy

    canadian overnight pharmacy

  23. [url=]betonline review poker[/url]

    betonline poker review twoplustwo

    betonline slots review

    review of betonline payout system

Оставьте комментарий!

grin LOL cheese smile wink smirk rolleyes confused surprised big surprise tongue laugh tongue rolleye tongue wink raspberry blank stare long face ohh grrr gulp oh oh downer red face sick shut eye hmmm mad angry zipper kiss shock cool smile cool smirk cool grin cool hmm cool mad cool cheese vampire snake excaim question

Имя и сайт используются только при регистрации