{"id":679,"date":"2014-06-05T09:29:01","date_gmt":"2014-06-05T16:29:01","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=679"},"modified":"2014-06-05T12:53:38","modified_gmt":"2014-06-05T19:53:38","slug":"ubuntu-on-a-zfs-root-file-system-for-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/ubuntu-on-a-zfs-root-file-system-for-ubuntu-14-04\/","title":{"rendered":"Ubuntu On a ZFS Root File System for Ubuntu 14.04"},"content":{"rendered":"
This is an update post to making an Ubuntu 14.04 (Trusty Tahr) OS work with ZFS root volume. Mostly the instructions remains the same as a previous post so this is a shortened version:
\nhttp:\/\/blog.ls-al.com\/booting-ubuntu-on-a-zfs-root-file-system\/<\/p>\n
Small warning I did this 4 times. It worked the first time but of course I did not document it well the first time and when I tried again I had grub issues.<\/p>\n
Step 1:<\/span><\/strong><\/p>\n ** Don't need grub ppa as per github instructions???<\/span><\/p>\n ** Will take quite a while kernel modules compiles!!<\/span><\/p>\n Step 2:<\/strong><\/span><\/p>\n ** Make partitions as follow<\/p>\n Step 3:<\/strong><\/span><\/p>\n Step 4:<\/strong><\/span><\/p>\n WTF: ** System seems hung. I see on a different terminal there was a messages system restart required. Weird. If you get this after debootstrap you have to redo Step 1 and Step 4.1 then...Is this because of only 2G RAM?<\/span><\/p>\n Step 5:<\/strong><\/span><\/p>\n Quick note on grub issues. \u00a0During the install I had to create soft links since I could not figure out the grub-probe failures. \u00a0From memory I think I created soft links as follow and purged grub2-common grub-pc and re-installed:<\/p>\n Update 5.6.14:<\/span> \u00a0After I had time to look at it closer I see my grub issues all came from the fact that there is no trusty grub ppa and the apt-add-repository command above is setting up a trusty repo. \u00a0Quickest way to fix this is after the apt-add-repository --yes ppa:zfs-native\/grub command fix the file manually to use raring. As follow:<\/p>\n Now ready to continue on.<\/p>\n Step 6:<\/strong><\/span><\/p>\n Step 7:<\/strong><\/span><\/p>\n Post First Reboot:<\/span><\/strong> TODO:<\/strong><\/span> This is an update post to making an Ubuntu 14.04 (Trusty Tahr) OS work with ZFS root volume. Mostly the<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,30],"tags":[],"class_list":["post-679","post","type-post","status-publish","format-standard","hentry","category-ubuntu","category-zfs"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=679"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/679\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}\r\n$ sudo -i\r\n# apt-add-repository --yes ppa:zfs-native\/stable\r\n<\/pre>\n
\r\n# apt-get update\r\n# apt-get install debootstrap ubuntu-zfs\r\n<\/pre>\n
\r\n# modprobe zfs\r\n# dmesg | grep ZFS:\r\n[ 1327.346821] ZFS: Loaded module v0.6.2-2~trusty, ZFS pool version 5000, ZFS filesystem version 5\r\n<\/pre>\n
\r\n# ls \/dev\/disk\/by-id\r\nata-VBOX_HARDDISK_VBb4fe25f7-8f14d419\r\nata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1\r\nata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part2\r\n\r\n# fdisk \/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419\r\n<\/pre>\n
\r\n# fdisk -l \/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419\r\n Device Boot Start End Blocks Id System\r\n\/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1 * 2048 206847 102400 be Solaris boot\r\n\/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part2 206848 16777215 8285184 bf Solaris\r\n<\/pre>\n
\r\n# mke2fs -m 0 -L \/boot\/grub -j \/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1\r\n# zpool create -o ashift=9 rpool \/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part2\r\n\r\n# zpool list\r\nNAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT\r\nrpool 7.88G 117K 7.87G 0% 1.00x ONLINE -\r\n\r\n# zfs create rpool\/ROOT\r\n# zfs create rpool\/ROOT\/ubuntu-1\r\n# zfs umount -a\r\n# zfs set mountpoint=\/ rpool\/ROOT\/ubuntu-1\r\n# zpool export rpool\r\n<\/pre>\n
\r\n# zpool import -d \/dev\/disk\/by-id -R \/mnt rpool\r\n# mkdir -p \/mnt\/boot\/grub\r\n# mount \/dev\/disk\/by-id\/scsi-SATA_disk1-part1 \/mnt\/boot\/grub\r\n# debootstrap trusty \/mnt\r\n<\/pre>\n
\r\n# cp \/etc\/hostname \/mnt\/etc\/\r\n# cp \/etc\/hosts \/mnt\/etc\/\r\n# tail -1 \/mnt\/etc\/fstab\r\n\/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1 \/boot\/grub auto defaults 0 1\r\n\r\n# mount --bind \/dev \/mnt\/dev\r\n# mount --bind \/proc \/mnt\/proc\r\n# mount --bind \/sys \/mnt\/sys\r\n# chroot \/mnt \/bin\/bash --login\r\n\r\n# locale-gen en_US.UTF-8\r\n# apt-get update\r\n# apt-get install ubuntu-minimal software-properties-common\r\n\r\n# apt-add-repository --yes ppa:zfs-native\/stable\r\n# apt-add-repository --yes ppa:zfs-native\/grub < - See below note on this command\r\n# apt-get update\r\n# apt-get install --no-install-recommends linux-image-generic linux-headers-generic\r\n# apt-get install ubuntu-zfs\r\n# apt-get install grub2-common grub-pc\r\n<\/pre>\n
\r\n\/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419 >>>> \/dev\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419\r\n\/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1 >>>> \/dev\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part1\r\n\/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part2 >>>> \/dev\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419-part2\r\n<\/pre>\n
\r\n# more \/etc\/apt\/sources.list.d\/zfs-native-grub-trusty.list\r\ndeb http:\/\/ppa.launchpad.net\/zfs-native\/grub\/ubuntu raring main\r\n<\/pre>\n
\r\n# apt-get install zfs-initramfs\r\n# apt-get dist-upgrade\r\n# passwd root\r\n<\/pre>\n
\r\n# grub-probe \/\r\nzfs\r\n# ls \/boot\/grub\/i386-pc\/zfs*\r\n\/boot\/grub\/i386-pc\/zfs.mod \/boot\/grub\/i386-pc\/zfsinfo.mod\r\n\r\n# update-initramfs -c -k all\r\nupdate-initramfs: Generating \/boot\/initrd.img-3.13.0-24-generic\r\n\r\n# grep "boot=zfs" \/boot\/grub\/grub.cfg\r\n\tlinux\t\/ROOT\/ubuntu-1@\/boot\/vmlinuz-3.13.0-24-generic root=ZFS=rpool\/ROOT\/ubuntu-1 ro boot=zfs\r\n\t\tlinux\t\/ROOT\/ubuntu-1@\/boot\/vmlinuz-3.13.0-24-generic root=ZFS=rpool\/ROOT\/ubuntu-1 ro boot=zfs\r\n\r\n# grep zfs \/etc\/default\/grub\r\nGRUB_CMDLINE_LINUX_DEFAULT="boot=zfs"\r\n\r\n# update-grub\r\n\r\n# grub-install $(readlink -f \/dev\/disk\/by-id\/ata-VBOX_HARDDISK_VBb4fe25f7-8f14d419)\r\nInstallation finished. No error reported.\r\n\r\n# exit\r\n<\/pre>\n
\r\n# umount \/mnt\/boot\/grub\r\n# umount \/mnt\/dev\r\n# umount \/mnt\/proc\r\n# umount \/mnt\/sys\r\n# zfs umount -a\r\n# zpool export rpool\r\n# reboot\r\n<\/pre>\n
\n- Made a VB snapshot of course
\n- apt-get install ubuntu-desktop
\n** grub issues again so I remade the link again. Later fixed with the grub ppa repo pointing to raring instead.
\n- create a user
\n- install VB Guest Additions<\/p>\n
\n- Check into grub issue and having to create soft links. Something to do with grub not following soft links.<\/p>\n","protected":false},"excerpt":{"rendered":"