Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial portability refactoring #32

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ec5d40a
initial portability patch
lloydie Feb 3, 2019
e88172a
initial portability refactor
lloydie Feb 3, 2019
2a866ed
initial portability refactor
lloydie Feb 3, 2019
b032d34
initial portability refactor
lloydie Feb 3, 2019
305c870
initial portability refactor
lloydie Feb 3, 2019
00ba391
initial portability refactor
lloydie Feb 3, 2019
c00bea7
initial portability refactor
lloydie Feb 3, 2019
547d6ae
initial portability refactor
lloydie Feb 3, 2019
e765856
initial portability refactor
lloydie Feb 3, 2019
3f29cae
initial portability refactor
lloydie Feb 3, 2019
75d17c4
initial portability refactor
lloydie Feb 3, 2019
0709a85
initial portability refactor
lloydie Feb 3, 2019
916925d
fix unbind local
lloydie Feb 3, 2019
79b163a
vagrant ubuntu-bionic-ubiquity
lloydie Feb 4, 2019
aa6e999
vagrant ubuntu-bionic-ubiquity
lloydie Feb 4, 2019
9bd7198
.
lloydie Feb 4, 2019
c10aeb6
.
lloydie Feb 4, 2019
6d078c8
wiki-update
lloydie Feb 4, 2019
4bb4f11
.
lloydie Feb 4, 2019
97bdd37
.
lloydie Feb 4, 2019
e6f04a9
.
lloydie Feb 5, 2019
1d7b62f
.
lloydie Feb 5, 2019
fca4b14
.
lloydie Feb 6, 2019
cfd2f36
.
lloydie Feb 6, 2019
01fbfff
.
lloydie Feb 6, 2019
ac07fdf
.
lloydie Feb 6, 2019
21ccc36
.
lloydie Feb 8, 2019
742afa7
.
lloydie Feb 9, 2019
9036d41
.
lloydie Feb 9, 2019
138a3c1
.
lloydie Feb 9, 2019
741dcb9
.
lloydie Feb 10, 2019
82ac5a3
.
lloydie Feb 10, 2019
11cd4bc
.
lloydie Feb 10, 2019
bc9fd91
chroot updates
lloydie Feb 11, 2019
44c0862
chroot updates
lloydie Feb 11, 2019
fd1999d
chroot updates
lloydie Feb 11, 2019
097b7f8
.
lloydie Feb 12, 2019
91a1de9
.
lloydie Feb 12, 2019
13827bd
.
lloydie Feb 13, 2019
098f431
.
lloydie Feb 13, 2019
c2957fc
.
lloydie Feb 13, 2019
2146833
.
lloydie Feb 13, 2019
8b127fb
.
lloydie Feb 14, 2019
ba7920e
.
lloydie Feb 14, 2019
787ec1f
vagrant apt_cache fix
lloydie Feb 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/iso
.*.swp
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
language: bash

149 changes: 60 additions & 89 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,89 +1,60 @@
# Rpooler
## A ZFS rpool wrapper for the Ubuntu 18.04 Ubiquity Installer
This is a wrapper that automates the creation of a fully bootable zfs root pool with Ubuntu 18.04 installed. It was crafted off the step-by-step [HOWTO install Ubuntu 18.04 to a Whole Disk Native ZFS Root Filesystem using Ubiquity GUI installer](https://github.com/zfsonlinux/pkg-zfs/wiki/HOWTO-install-Ubuntu-18.04-to-a-Whole-Disk-Native-ZFS-Root-Filesystem-using-Ubiquity-GUI-installer). The goals are to further simplfy the installation process and encourage best practices through the guided process.

Instructions:
1) Boot Ubuntu 18.04 Desktop Live CD
2) Select "Try Ubuntu"
3) Open terminal (Ctrl+Alt+t)
4) `wget https://raw.github.com/ghfields/rpooler/master/rpooler.sh`
5) `sudo bash rpooler.sh`


## What to expect when running script
```
Installer script for ZFS whole disk installation using Ubuntu GUI (Ubiquity)
----------------------------------------------------------------------------
What do you want to name your pool?
rpool

These are the drives on your system:
/dev/disk/by-id/ata-VBOX_CD-ROM_VB2-01700376
/dev/disk/by-id/ata-VBOX_HARDDISK_VB9c4c6292-31c83b83
What vdev layout do you want to use? (hint: tab completion works):
/dev/disk/by-id/ata-VBOX_HARDDISK_VB9c4c6292-31c83b83

Which zpool & zfs options do you wish to set at creation?
-o feature@multi_vdev_crash_dump=disabled -o feature@large_dnode=disabled -o feature@sha512=disabled -o feature@skein=disabled -o feature@edonr=disabled -o ashift=12 -O atime=off -O compression=lz4 -O normalization=formD -O recordsize=1M -O xattr=sa

Zpool would create 'rpool' with the following layout:

rpool
ata-VBOX_HARDDISK_VB9c4c6292-31c83b83

Does this look correct (y/n):
y

The Ubiquity made swapfile will not function and will be removed.
Based on your system's 3.85 GB of RAM, Ubuntu suggests a swap of 2 GB.
What size, in GB, should the created swap zvol be? (0 for none):
2
Zvol swap size: 2 GB
Is this correct (y/n):
y

Configuring the Ubiquity Installer
----------------------------------
1) Choose any options you wish until you get to the 'Installation Type' screen.
2) Select 'Erase disk and install Ubuntu' and click 'Continue'.
3) Change the 'Select drive:' dropdown to '/dev/zd0 - 10.7 GB Unknown' and click 'Install Now'.
4) A popup summarizes your choices and asks 'Write the changes to disks?'. Click 'Continue'.
5) At this point continue through the installer normally.
6) Finally, a message comes up 'Installation Complete'. Click the 'Continue Testing'.
This install script will continue.

Press any key to launch Ubiquity. These instructions will remain visible in the terminal window.


======
Ubiquity Launches
======

(Rsync output truncated)

Setting up zfs-initramfs (0.7.5-1ubuntu16.2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for initramfs-tools (0.130ubuntu3.1) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-29-generic
cp: memory exhausted
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-29-generic
Found initrd image: /boot/initrd.img-4.15.0-29-generic
Found memtest86+ image: /ROOT/ubuntu-1@/boot/memtest86+.elf
Found memtest86+ image: /ROOT/ubuntu-1@/boot/memtest86+.bin
done
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Installing for i386-pc platform.
Installation finished. No error reported.
Would you like to create a snapshot before rebooting? :
y

Script complete. Please reboot your computer to boot into your installation.
If first boot hangs, reset computer and try boot again.

Do you want to restart now?
n
```
# About

zfs-install automates the creation of a fully bootable zfs root pool.


## Thanks

Garrett Fields [original script](https://github.com/ghfields/rpooler)
Rui [vagrant apt cache](https://github.com/rgl/apt-cache-vagrant)

## Roadmap
This project is in developement and unstable, please use rpooler in meantime.

Please see wiki for general state of the project

## zfs documentation

aaron-toponce [General zfs introduction and guidelines](https://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/)

video:

Linda Kately [Open-ZFS Bootcamp](https://www.youtube.com/watch?v=mLbtJQmfumI&feature=youtu.be)

## zfsonlinux community documentation for specific distributions.

ubuntu-ubiquity [HOWTO install Ubuntu 18.04 to a Whole Disk Native ZFS Root Filesystem using Ubiquity GUI installer](https://github.com/zfsonlinux/pkg-zfs/wiki/HOWTO-install-Ubuntu-18.04-to-a-Whole-Disk-Native-ZFS-Root-Filesystem-using-Ubiquity-GUI-installer).

## Goals
- Simplfy the installation process to the point of automation.
- Upstream and intergrate as is "legally" possible. I wish this script wasn't required.
- Encourage best practices through the guides practices.

## Supported distributions
Currently only ubuntu using the ubiquity installer is the only option.

- ubuntu/bionic

TODO
- arch
- gentoo
- debian
- rhel
- centos
- opensuse
- linuxfromscratch

## Instructions
1) Boot supported distribtion
2) run zfs-install.sh
3) answer any required questions.
4) Your done.

## Contributions
Any and all contibutions in any form are encouraged and most welcome.

There doesn't appear to be many people interested in this project, thats cool!
I would appreciate the time of any other zfs users.

- What method do you use to "bootstrap" zfs for your use case ?
- I'm guessing most people are using packer to create custom iso's. is this Correct ?
File renamed without changes.
85 changes: 85 additions & 0 deletions doc/fdisk_partition_types
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
1 EFI System C12A7328-F81F-11D2-BA4B-00A0C93EC93B
2 MBR partition scheme 024DEE41-33E7-11D3-9D69-0008C781F39F
3 Intel Fast Flash D3BFE2DE-3DAF-11DF-BA40-E3A556D89593
4 BIOS boot 21686148-6449-6E6F-744E-656564454649
5 Sony boot partition F4019732-066E-4E12-8273-346C5641494F
6 Lenovo boot partition BFBFAFE7-A34F-448A-9A5B-6213EB736C22
7 PowerPC PReP boot 9E1A2D38-C612-4316-AA26-8B49521E5A8B
8 ONIE boot 7412F7D5-A156-4B13-81DC-867174929325
9 ONIE config D4E6E2CD-4469-46F3-B5CB-1BFF57AFC149
10 Microsoft reserved E3C9E316-0B5C-4DB8-817D-F92DF00215AE
11 Microsoft basic data EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
12 Microsoft LDM metadata 5808C8AA-7E8F-42E0-85D2-E1E90434CFB3
13 Microsoft LDM data AF9B60A0-1431-4F62-BC68-3311714A69AD
14 Windows recovery environment DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
15 IBM General Parallel Fs 37AFFC90-EF7D-4E96-91C3-2D7AE055B174
16 Microsoft Storage Spaces E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D
17 HP-UX data 75894C1E-3AEB-11D3-B7C1-7B03A0000000
18 HP-UX service E2A1E728-32E3-11D6-A682-7B03A0000000
19 Linux swap 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
20 Linux filesystem 0FC63DAF-8483-4772-8E79-3D69D8477DE4
21 Linux server data 3B8F8425-20E0-4F3B-907F-1A25A76F98E8
22 Linux root (x86) 44479540-F297-41B2-9AF7-D131D5F0458A
23 Linux root (ARM) 69DAD710-2CE4-4E3C-B16C-21A1D49ABED3
24 Linux root (x86-64) 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709
25 Linux root (ARM-64) B921B045-1DF0-41C3-AF44-4C6F280D3FAE
26 Linux root (IA-64) 993D8D3D-F80E-4225-855A-9DAF8ED7EA97
27 Linux reserved 8DA63339-0007-60C0-C436-083AC8230908
28 Linux home 933AC7E1-2EB4-4F13-B844-0E14E2AEF915
29 Linux RAID A19D880F-05FC-4D3B-A006-743F0F84911E
30 Linux extended boot BC13C2FF-59E6-4262-A352-B275FD6F7172
31 Linux LVM E6D6D379-F507-44C2-A23C-238F2A3DF928
32 FreeBSD data 516E7CB4-6ECF-11D6-8FF8-00022D09712B
33 FreeBSD boot 83BD6B9D-7F41-11DC-BE0B-001560B84F0F
34 FreeBSD swap 516E7CB5-6ECF-11D6-8FF8-00022D09712B
35 FreeBSD UFS 516E7CB6-6ECF-11D6-8FF8-00022D09712B
36 FreeBSD ZFS 516E7CBA-6ECF-11D6-8FF8-00022D09712B
37 FreeBSD Vinum 516E7CB8-6ECF-11D6-8FF8-00022D09712B
38 Apple HFS/HFS+ 48465300-0000-11AA-AA11-00306543ECAC
39 Apple UFS 55465300-0000-11AA-AA11-00306543ECAC
40 Apple RAID 52414944-0000-11AA-AA11-00306543ECAC
41 Apple RAID offline 52414944-5F4F-11AA-AA11-00306543ECAC
42 Apple boot 426F6F74-0000-11AA-AA11-00306543ECAC
43 Apple label 4C616265-6C00-11AA-AA11-00306543ECAC
44 Apple TV recovery 5265636F-7665-11AA-AA11-00306543ECAC
45 Apple Core storage 53746F72-6167-11AA-AA11-00306543ECAC
46 Solaris boot 6A82CB45-1DD2-11B2-99A6-080020736631
47 Solaris root 6A85CF4D-1DD2-11B2-99A6-080020736631
48 Solaris /usr & Apple ZFS 6A898CC3-1DD2-11B2-99A6-080020736631
49 Solaris swap 6A87C46F-1DD2-11B2-99A6-080020736631
50 Solaris backup 6A8B642B-1DD2-11B2-99A6-080020736631
51 Solaris /var 6A8EF2E9-1DD2-11B2-99A6-080020736631
52 Solaris /home 6A90BA39-1DD2-11B2-99A6-080020736631
53 Solaris alternate sector 6A9283A5-1DD2-11B2-99A6-080020736631
54 Solaris reserved 1 6A945A3B-1DD2-11B2-99A6-080020736631
55 Solaris reserved 2 6A9630D1-1DD2-11B2-99A6-080020736631
56 Solaris reserved 3 6A980767-1DD2-11B2-99A6-080020736631
57 Solaris reserved 4 6A96237F-1DD2-11B2-99A6-080020736631
58 Solaris reserved 5 6A8D2AC7-1DD2-11B2-99A6-080020736631
59 NetBSD swap 49F48D32-B10E-11DC-B99B-0019D1879648
60 NetBSD FFS 49F48D5A-B10E-11DC-B99B-0019D1879648
61 NetBSD LFS 49F48D82-B10E-11DC-B99B-0019D1879648
62 NetBSD concatenated 2DB519C4-B10E-11DC-B99B-0019D1879648
63 NetBSD encrypted 2DB519EC-B10E-11DC-B99B-0019D1879648
64 NetBSD RAID 49F48DAA-B10E-11DC-B99B-0019D1879648
65 ChromeOS kernel FE3A2A5D-4F32-41A7-B725-ACCC3285A309
66 ChromeOS root fs 3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC
67 ChromeOS reserved 2E0A753D-9E48-43B0-8337-B15192CB1B5E
68 MidnightBSD data 85D5E45A-237C-11E1-B4B3-E89A8F7FC3A7
69 MidnightBSD boot 85D5E45E-237C-11E1-B4B3-E89A8F7FC3A7
70 MidnightBSD swap 85D5E45B-237C-11E1-B4B3-E89A8F7FC3A7
71 MidnightBSD UFS 0394EF8B-237E-11E1-B4B3-E89A8F7FC3A7
72 MidnightBSD ZFS 85D5E45D-237C-11E1-B4B3-E89A8F7FC3A7
73 MidnightBSD Vinum 85D5E45C-237C-11E1-B4B3-E89A8F7FC3A7
74 Ceph Journal 45B0969E-9B03-4F30-B4C6-B4B80CEFF106
75 Ceph Encrypted Journal 45B0969E-9B03-4F30-B4C6-5EC00CEFF106
76 Ceph OSD 4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D
77 Ceph crypt OSD 4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D
78 Ceph disk in creation 89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE
79 Ceph crypt disk in creation 89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE
80 OpenBSD data 824CC7A0-36A8-11E3-890A-952519AD3F61
81 QNX6 file system CEF5A9AD-73BC-4601-89F3-CDEEEEE321A1
82 Plan 9 partition C91818F9-8025-47AF-89D2-F030D7000C2C


Command (m for help):
Loading