Install experience 16.04.3 nvidia fakeraid dm-cache

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Xen
Reply | Threaded
Open this post in threaded view
|

Install experience 16.04.3 nvidia fakeraid dm-cache

Xen
Took me some 8 hours to install Kubuntu 16.04.3 ;-).

The nVidia nForce chipsets motherboards of old (AM2+) have built-in
support in Linux for their RAID.

Grub2 comes with the dm_nv.mod module which allows Grub2 to actually
read everything on the disk.

This requires at least "grub-install <device> --modules "diskfilter
dm_nv"" but I think also GRUB_PRELOAD_MODULES="diskfilter dm_nv", not
sure.

After that Grub is already set and done.

Initramfs was more difficult. Dmraid doesn't come with an adequate
/usr/share/initramfs-tools/scripts/local-top/dmraid, although I am
grateful it comes with anything at all.

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

Fixed that basically.

But I also wanted to cache my root filesystem. Now unfortunately Ubuntu
still doesn't provide thin-provisioning-tools by default.

Also there is a bug in Ubiquity
(https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1607687) in
which the failure of the Grub installation causes package corruption.

You cannot decide not to install Grub, so this means that any system in
which manual Grub installation is required ends up with some broken
packages.

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

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Xen
Reply | Threaded
Open this post in threaded view
|

Re: Install experience 16.04.3 nvidia fakeraid dm-cache

Xen
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.

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users