install pve on usb raidz0
fix zfs
/sbin/modprobe zfs
update repository listnano /etc/apt/sources.listadd debhttp://download.proxmox.com/debian/pvestretch pve-no-subscriptionapt-get updateapt-get upgrade -yshutdown -r 0 #reboot設定 zfs
ls /dev/disk/by-id # disk id
zpool create -f storage raidz2 [disk-id]
zpool create -f storage raidz2 ata-HGST_HUS726040ALE610_K4HATTSB ata-HGST_HUS726040ALE610_K4HATTYB ata-HGST_HUS726040ALE610_K4HAU4JB ata-HGST_HUS726040ALE610_K4HAU5LB ata-HGST_HUS726040ALE610_K4HNNGLB ata-HGST_HUS726040ALE610_K4HPBS2B ata-HGST_HUS726040ALE610_NHGLT09Y ata-HGST_HUS726040ALE610_NHGLUNRY
避免usb 大量讀寫
zfs create storage/varmkdir /storage/var/logcp -rp /var/log/* /storage/var/log/mv /var/log /var/log.bakln -s /storage/var/log /var/logmkdir /storage/var/cachecp -rp /var/cache/* /storage/var/cache/mv /var/cache /var/cache.bakln -s /storage/var/cache /var/cachemkdir /storage/var/libmkdir /storage/var/lib/vzcp -rp /var/lib/vz/* /storage/var/lib/vz/mv /var/lib/vz /var/lib/vz.bakln -s /storage/var/lib/vz /var/lib/vzzfs create -V 32G -b $(getconf PAGESIZE) -o compression=zle -o logbias=throughput -o sync=always -o primarycache=metadata -o secondarycache=none -o com.sun:auto-snapshot=false storage/swapmkswap -f /dev/zvol/storage/swapecho /dev/zvol/storage/swap none swap defaults 0 0 >> /etc/fstabswapon -av zfs destroy rpool/swap把/etc/fstab 裡面的 swap 給 comment 掉
安裝完成後以 USB隨身碟開機會在開機過程中卡住中斷,原因是因為以usb 開機時系統載入的速度較快,而此時系統尚未載入usb driver ,導致找不到 usb隨身碟上的 zfs rpool 分割區而無法正常開機,所以要在/boot/grub/grub.cfg的內容加上 rootdelay=20,再重開測試就可以正常開機,而加入這個指令是先延遲20秒的時間讓系統先載入 usb driver 後再載入 開機系統
zfs create storage/sharezfs create storage/share/isozfs create storage/vmstoragezfs create storage/vmstorage/limitedzfs set quota=1000G storage/vmstorage/limitedzfs listzpool statuszpool iostat -vin GUI
Click on"Datacenter""Storage""Add""Directory"`ID: iso` `Directory: /storage/share/iso` `Content: make sure only "ISO image" and "Container template" are selected.` `"Add"` And again... `"Add"` `"ZFS"` `ID: vmstorage` `ZFS Pool: /storage/vmstorage`And again...
`"Add"` `"ZFS"` `ID: vmstoragelimited` `ZFS Pool: /storage/vmstorage/limited` `"Add"`支援 samba ad 下面的 ACL
zfs set acltype="posixacl" storage
#############################################################
彩色終端
when you run the following command in terminal
eval `dircolors /path/to/dircolorsdb`
The stored database is loaded andlsoutput colors changes accordingly. If you close the existing terminal it will not be available anymore. To make the change permanent.
- Create a file
~/.dir_colors- Copy the color database file (that you want to apply) in it.
- Add the following command at the end of
~/.bashrc.
eval `dircolors ~/.dir_colors`
- Source
~/.bashrcusing the command in terminal
source ~/.bashrc
It will activate the theme for all future shell sessions.
配色找 solarized
#############################################################
mount -t proc none /storage/vmstorage/limited/subvol-100-disk-1/proc/
mount --rbind /dev/ /storage/vmstorage/limited/subvol-100-disk-1/dev/
mount --rbind /sys/ /storage/vmstorage/limited/subvol-100-disk-1/sys/
chroot /storage/vmstorage/limited/subvol-100-disk-1/ /bin/bash
zpool status
zfs list