
Hi, On 21/05/18 00:59, Russell Coker via luv-main wrote:
On Sunday, 20 May 2018 10:27:53 AM AEST Mike O'Connor via luv-main wrote:
I suggest the following.
1. Do not use ZFS unless you have ECC ram
If you use a filesystem like BTRFS or ZFS and have memory errors then it will become apparent fairly quickly so you can then restore from backups. If you use a filesystem like Ext4 and have memory errors then you can have your data become increasingly corrupt for an extended period of time before you realise it.
Perhaps a better question for a new thread, but it would be interesting to know whether or not the whole ECC only for ZFS is really a thing and if it gives anybody grief without ECC.
Well LVMs give a lot of options which as not available if there not there. This site has only a very simple example but give it a read http://tldp.org/HOWTO/LVM-HOWTO/benefitsoflvmsmall.html
That document says "Joe buys a PC with an 8.4 Gigabyte disk". I just checked the MSY pricelist, the smallest disk they sell is 1TB and the smallest SSD they sell is 120G. Any document referencing 8G disks is well out of date.
LOL. This is what I do, routinely, as a first preference: - I mirror every single disk (no RAID5 / RAID6 usually). - one partition for /boot on ext4 on the bootable disk set - the rest as one partition for a crypt volume - Encryption, using LUKS (crypt volumes) NB: the separate primary /boot partition should be of reasonable size, heck, the size of disks these days, it doesn't hurt to give it 2GB, knowing that is overkill of course (unless you store ISO files on it, then you may as well go larger), the rest of the boot disk is a LUKS volume that is a volume group for LVM, it is very, very easy to use, once you understand how it hangs together. For servers that I want to be headless, I boot to a dropbear ssh environment. Unlock the crypt (LUKS) volume which allows swap, root and other file systems on LVM to be available for next phase of boot; kill the process that sits on the console asking for the crypt password as we've already unlocked the LUKS volume within dropbear, boot continues when that process is killed; exit from the dropbear environment. For ordinary non server machines that have a display and keyboard easily available, such as a laptop, I don't use dropbear. Within dropbear I have aliases like these to help: # dropbear aliases alias db1='/sbin/cryptsetup luksOpen /dev/md0 md0_crypt' alias db2='/sbin/cryptsetup luksOpen /dev/md1 md1_crypt' alias db3='/sbin/cryptsetup luksOpen /dev/md2 md2_crypt' alias db4='/sbin/cryptsetup status md0_crypt' alias db5='/sbin/cryptsetup status md1_crypt' alias db6='/sbin/cryptsetup status md2_crypt' alias db7='ps|grep askpass;echo kill -9 $(pidof askpass)' alias db8='kill -9 $(pidof askpass)' # mdadm aliases alias mdadm='/sbin/mdadm' alias mdstat='cat /proc/mdstat' alias md0='mdadm -D /dev/md0' alias md1='mdadm -D /dev/md1' alias md2='mdadm -D /dev/md2' It can be a bit of a task to get all the right tools and custom environment (including extra files) available in my initrd file with initramfs.hooks.... see script below. With my setup, root is an LVM volume that lives on the encrypted volume that is an mdadm (RAID1) mirror. Aside from using btrfs or ZFS.... I cannot understand opposition to lvm, it's wonderful. With LVM you get snapshots, your volumes have names, it's very easy to find the /dev files and /dev/mapper files if you know the volume group and lv names, you can query UUID with 'blkid -c /dev/null', and definitely use UUIDs in /etc/fstab -- much simpler than mucking around with labels on partitions. I use ext4 on most of the logical volumes (lvs), excepting swap of course. If I need to increase the size of a file system, then I resize the lv and then use 'resize2fs' and it magically gets larger -- in this case, I can do so on-line as well (without unmounting the file system). I rarely shrink volumes, but it is possible, just be careful whenever you resize volumes, especially when shrinking to get your process 100% correct so you don't screw up the file system. Kind Regards AndrewM Helper script for extra progs [and environment setup] for dropbear environment use: # cat /usr/share/initramfs-tools/hooks/other #!/bin/sh PREREQ="" prereqs() { echo "$PREREQ" } case "$1" in prereqs) prereqs exit 0 ;; esac . "${CONFDIR}/initramfs.conf" . /usr/share/initramfs-tools/hook-functions # Install /bin/ binaries for binary in bash do copy_exec "/bin/$binary" "/bin/" done # Install /sbin/ binaries for binary in badblocks blkid fdisk hdparm parted do copy_exec "/sbin/$binary" "/sbin/" done # Install /usr/bin/ binaries for binary in last nohup pv screen tee vim who do copy_exec "/usr/bin/$binary" "/usr/bin/" done # Install other root files if [ -d /etc/initramfs-tools/root.other_files ]; then (cd /etc/initramfs-tools/root.other_files/;tar cf - . | (cd "${DESTDIR}/root/";tar xvf -)) fi