Erinevus lehekülje "Vinum gvinum ja geom" redaktsioonide vahel
1. rida: | 1. rida: | ||
===Geli=== | ===Geli=== | ||
− | rc.conf | + | Ketaste krüpteerimine FreeBSD süsteemis |
+ | |||
+ | Kõigepealt on vaja geli tuge tuuma. Seda saab kas | ||
+ | kompileerides tuuma uuesti või lihtsam lisada '''/etc/rc.conf'' | ||
+ | faili rida | ||
geom_eli_load="YES" | geom_eli_load="YES" | ||
− | cryptosoft0: <software crypto> on motherboard | + | ja teha reboot |
+ | |||
+ | peale rebooti peaks dmesgis olema näha rida | ||
+ | |||
+ | cryptosoft0: <software crypto> on motherboard | ||
+ | Ketas mida soovime krüpteerida on '''/dev/da0''' | ||
+ | |||
+ | Teeme kettale vajaliku võtme | ||
dd if=/dev/random of=/root/da0.key bs=64 count=1 | dd if=/dev/random of=/root/da0.key bs=64 count=1 | ||
12. rida: | 23. rida: | ||
1+0 records out | 1+0 records out | ||
64 bytes transferred in 0.000397 secs (161126 bytes/sec) | 64 bytes transferred in 0.000397 secs (161126 bytes/sec) | ||
+ | |||
+ | Seejärel seome võtme kettaseadmega ja paneme paika parooli | ||
+ | millega saame edaspidi kasutada | ||
geli init -s 4096 -K /root/da0.key /dev/da0 | geli init -s 4096 -K /root/da0.key /dev/da0 | ||
Enter new passphrase: | Enter new passphrase: | ||
Reenter new passphrase: | Reenter new passphrase: | ||
+ | |||
+ | Ning haagime ketta külge | ||
geli attach -k /root/da0.key /dev/da0 | geli attach -k /root/da0.key /dev/da0 | ||
Enter passphrase: | Enter passphrase: | ||
− | GEOM_ELI: Device da0.eli created. | + | dmesgi peaks ilmuma seejäre teade |
− | GEOM_ELI: Encryption: AES-CBC 128 | + | |
− | GEOM_ELI: Crypto: software | + | GEOM_ELI: Device da0.eli created. |
+ | GEOM_ELI: Encryption: AES-CBC 128 | ||
+ | GEOM_ELI: Crypto: software | ||
+ | |||
+ | kausta /dev peaks nüüd olema tekkinud uus seade da0.eli | ||
ls /dev/da0* | ls /dev/da0* | ||
/dev/da0 /dev/da0.eli | /dev/da0 /dev/da0.eli | ||
+ | |||
+ | Alustame uue failisüsteemi loomist. Selleks on | ||
+ | soovitatav kirjutada kogu ketas algusest lõpuni suvalise infoga üle. | ||
+ | See võib võtta suurema ketta puhul aega 3-4 tundi. | ||
dd if=/dev/random of=/dev/da0.eli bs=1m | dd if=/dev/random of=/dev/da0.eli bs=1m | ||
40859860992 bytes transferred in 10024.286856 secs (4076087 bytes/sec) | 40859860992 bytes transferred in 10024.286856 secs (4076087 bytes/sec) | ||
+ | |||
+ | Loome uue failisüsteemi | ||
newfs /dev/da0.eli | newfs /dev/da0.eli | ||
34. rida: | 60. rida: | ||
using 207 cylinder groups of 336.98MB, 21567 blks, 21568 inodes. | using 207 cylinder groups of 336.98MB, 21567 blks, 21568 inodes. | ||
super-block backups (for fsck -b #) at: | super-block backups (for fsck -b #) at: | ||
+ | |||
+ | Ja moundime enda ketta | ||
mount /dev/da0.eli /mnt | mount /dev/da0.eli /mnt | ||
42. rida: | 70. rida: | ||
/dev/da0.eli 70009144 8 64408408 0% /mnt | /dev/da0.eli 70009144 8 64408408 0% /mnt | ||
+ | Lahtihaakimiseks käsud | ||
umount /mnt | umount /mnt | ||
geli detach da0.eli | geli detach da0.eli | ||
+ | |||
+ | Ja dmesgi tekib lahtiühenduse kohta teade | ||
GEOM_ELI: Device da0.eli destroyed. | GEOM_ELI: Device da0.eli destroyed. | ||
+ | |||
+ | Uuesti haakida saab siis käskudega. Kasutada | ||
+ | tuleb varem nimetatud paroole | ||
geli attach -k /root/da0.key /dev/da0 | geli attach -k /root/da0.key /dev/da0 | ||
mount /dev/da0.eli /mnt | mount /dev/da0.eli /mnt | ||
− | rc.conf | + | rc.conf'i automaatseks stardiks. |
+ | Ei pääse muidugi iga taaskäivituse järle paroolide trükkimisest | ||
geli_devices="da0" | geli_devices="da0" |
Redaktsioon: 30. detsember 2007, kell 17:40
Geli
Ketaste krüpteerimine FreeBSD süsteemis
Kõigepealt on vaja geli tuge tuuma. Seda saab kas kompileerides tuuma uuesti või lihtsam lisada '/etc/rc.conf faili rida
geom_eli_load="YES"
ja teha reboot
peale rebooti peaks dmesgis olema näha rida
cryptosoft0: <software crypto> on motherboard
Ketas mida soovime krüpteerida on /dev/da0
Teeme kettale vajaliku võtme
dd if=/dev/random of=/root/da0.key bs=64 count=1 1+0 records in 1+0 records out 64 bytes transferred in 0.000397 secs (161126 bytes/sec)
Seejärel seome võtme kettaseadmega ja paneme paika parooli millega saame edaspidi kasutada
geli init -s 4096 -K /root/da0.key /dev/da0 Enter new passphrase: Reenter new passphrase:
Ning haagime ketta külge
geli attach -k /root/da0.key /dev/da0 Enter passphrase:
dmesgi peaks ilmuma seejäre teade
GEOM_ELI: Device da0.eli created. GEOM_ELI: Encryption: AES-CBC 128 GEOM_ELI: Crypto: software
kausta /dev peaks nüüd olema tekkinud uus seade da0.eli
ls /dev/da0* /dev/da0 /dev/da0.eli
Alustame uue failisüsteemi loomist. Selleks on soovitatav kirjutada kogu ketas algusest lõpuni suvalise infoga üle. See võib võtta suurema ketta puhul aega 3-4 tundi.
dd if=/dev/random of=/dev/da0.eli bs=1m 40859860992 bytes transferred in 10024.286856 secs (4076087 bytes/sec)
Loome uue failisüsteemi
newfs /dev/da0.eli /dev/da0.eli: 69464.8MB (142263992 sectors) block size 16384, fragment size 4096 using 207 cylinder groups of 336.98MB, 21567 blks, 21568 inodes. super-block backups (for fsck -b #) at:
Ja moundime enda ketta
mount /dev/da0.eli /mnt
df Filesystem 1K-blocks Used Avail Capacity Mounted on ... /dev/da0.eli 70009144 8 64408408 0% /mnt
Lahtihaakimiseks käsud
umount /mnt geli detach da0.eli
Ja dmesgi tekib lahtiühenduse kohta teade
GEOM_ELI: Device da0.eli destroyed.
Uuesti haakida saab siis käskudega. Kasutada tuleb varem nimetatud paroole
geli attach -k /root/da0.key /dev/da0 mount /dev/da0.eli /mnt
rc.conf'i automaatseks stardiks. Ei pääse muidugi iga taaskäivituse järle paroolide trükkimisest
geli_devices="da0" geli_da2_flags="-p -k /root/da0.key"
vinum
Starting up Vinum Early Enough for the Root Filesystem /boot/loader.conf
vinum_load="YES"
/boot/loader.conf grub start
geom_vinum_load="YES" vinum.autostart="YES"
fdisk -i teha
disklabel -w
disklabel -e devname
stripe
drive c device /dev/da5h drive d device /dev/da6h volume stripe plex org striped 512k sd length 128m drive c sd length 128m drive d
mirroring
drive d1 device /dev/ad2s1a drive d2 device /dev/ad3s1a volume mirror setupstate
plex org concat sd length 76000M drive d1 plex org concat sd length 76000M drive d2
gvinum create -f /etc/vinum.conf
hiljem newfs -v
gstripe
kldload geom_mirror
/boot/loader.conf geom_stripe_load="YES"
gstripe label -v -s 4096 data /dev/ad2 /dev/ad4 newfs /dev/stripe/data mount /dev/stripe/data /mnt/tank2 df -h /dev/stripe/data 289G 4.0K 266G 0% /mnt/tank2
cat /var/run/dmesg.boot | grep "ad" gstripe list umount /dev/stripe/data tunefs -m 2 -o space /dev/stripe/data tunefs: minimum percentage of free space changes from 8% to 2% tunefs: should optimize for space with minfree < 8% tunefs: optimization preference changes from time to space
mount /dev/stripe/data /mnt/tank2 /dev/stripe/data 289G 4.0K 283G 0% /mnt/tank2
-m 2 ütleb, et minfree peaks 2% olema ja -o space optimiseerib space'le, mitte access time'le aga kiiremat kaablit vaja, udma33 sucks ASS
fsck_ffs /dev/stripe/data
gmirror
katse# gmirror label -vnb round-robin gm0 /dev/da1 Metadata value stored on /dev/da1. Done. katse# gmirror load katse# gmirror insert gm0 /dev/da2
newfs /dev/mirror/gm0 mount /dev/mirror/gm0s1d /mnt
raid 10
kettaid neil ad1 ad2 ad3 ad4
gmirror label -vnb round-robin gm0 /dev/da1 gmirror load gmirror insert gm0 /dev/da2 gmirror label -vnb round-robin gm1 /dev/da3 gmirror insert gm1 /dev/da4 gstripe label -v -s 4096 data /dev/mirror/gm0 /dev/mirror/gm1 newfs /dev/stripe/data mount /dev/stripe/data /mnt