osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Install experience 16.04.3 nvidia fakeraid dm-cache


Xen schreef op 26-10-2017 10:14:

> Dmraid, cifs-utils, and libgtmm are effected, among possibly others.

Unfortunately Ubiquity leaves behind no installer logs.



But anyway, dm-cache for the root device requires both kernel modules 
and scripts to be copied into the initramfs. It is sad that 
thin-provisioning-tools is in such a sad state.

The required modules (dm_cache.ko and dm_cache_smq.ko, I believe) have 
to be copied to /etc/initramfs-tools/modules, or a hook script created 
with:

add_modules_dir kernel/drivers/md         to just copy the whole bunch.

copy_exec /usr/sbin/pdata_tools
for f in /usr/sbin/cache*; do ln -sr ${DESTDIR}/usr/sbin/pdata_tools 
${DESTDIR}$f; done

Is also required to thus make sure cache_check can execute upon LVM 
activation.



So steps required for nVidia raid:

- grub-install --modules "diskfilter dm_nv"
- echo 'GRUB_PRELOAD_MODULES="diskfilter dm_nv' >> /etc/default/grub

- cp /usr/share/initramfs-tools/scripts/local-top/dmraid 
/etc/initramfs-tools/scripts/local-top
- echo "dmraid -ay" >> /etc/initramfs-tools/scripts/local-top/dmraid

Steps required for dm-cache:

- apt install thin-provisioning-tools
- copy the script preamble from "man initramfs-tools"
- put it in /etc/initramfs-tools/hooks/dmcache
- chmod +x /etc/initramfs-tools/hooks/dmcache

- add:
     add_modules_dir kernel/drivers/md
     copy_exec /usr/sbin/pdata_tools
     for f in /usr/sbin/cache*; do ln -sr ${DESTDIR}/usr/sbin/pdata_tools 
${DESTDIR}$f; done

And you will now have a system that is capable of booting from a 
LVM-cache enabled root device.




What does this mean.

If you have a root Logical Volume like /dev/ubuntu-vg/root

And you are using a regular harddisk.
And you can add a smaller SSD, such as mSata SSD.

Then you could create a cached root volume by doing:

- < first create a partition on the SSD for LVM >

- pvcreate /dev/<ssd partition>
- vgextend ubuntu-vg <ssd partition>
- (assuming now that the ssd partition is /dev/sdb1

- lvcreate ubuntu-vg -n root_cache_meta -L 24M /dev/sdb1
- lvcreate ubuntu-vg -n root_cache -l 98%free /dev/sdb1

- lvconvert --type cache-pool --poolmetadata ubuntu-vg/root_cache_meta 
ubuntu-vg/root_cache

- lvconvert --type cache --cachepool ubuntu_vg/root_cache ubuntu_vg/root

The above numbers assume a cache partition of less than ~12GB, you may 
need a larger meta volume but LVM will warn you about that on the first 
lvconvert.

At this point you have a cached root and will have faster boots and 
application startup times.