Adding a new disk to Proxmox VE

root@elizabeth:/etc/lvm# fdisk /dev/sdb

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): g

Created a new GPT disklabel (GUID: DBD738EC-7ED5-4FC0-9474-1018CF3E4F12).

Command (m for help): n
Partition number (1-128, default 1):
First sector (34-500118158, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-500118158, default 500118158):

Created a new partition 1 of type 'Linux filesystem' and of size 238.5 GiB.

Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Type of partition 1 is unchanged: Linux filesystem.

Command (m for help): p
Disk /dev/sdb: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DBD738EC-7ED5-4FC0-9474-1018CF3E4F12

Device Start End Sectors Size Type
/dev/sdb1 2048 500118158 500116111 238.5G Linux filesystem

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

root@elizabeth:/etc/lvm# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created.
root@elizabeth:/etc/lvm# vgcreate ssd2 /dev/sdb1
Volume group "ssd2" successfully created
root@elizabeth:/etc/lvm# lvcreate --type thin-pool -L 100G -n data ssd2
Logical volume "data" created.
root@elizabeth:/etc/lvm# lvextend -l +100%FREE ssd2/data
Size of logical volume ssd2/data changed from 100.00 GiB (25600 extents) to 238.47 GiB (61049 extents).
Logical volume ssd2/data successfully resized.

Then it is possible to add the newly created LVM-Thin volume from the Web interface.

Building userdebug android images for Pixel

Those are the steps I took to build userdebug images for google Pixel on Ubtuntu 16.04. As the original google documentation is so unorganized and difficult to understand I’ve summed up the important parts to get a quick build for any device. I’m quite unsure about the package dependencies and there might be some more packages you need. Let me know if you needed more packages on clean install of Ubuntu.

1. First start with installing necessary packages

sudo apt-get update
sudo apt-get install bc bison build-essential curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev openjdk-8-jdk

2. Building android somehow requires some x86 libraries so install them as well

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

3. Download repo client and install it somewhere

mkdir ~/bin
PATH=~/bin:$PATH

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

4. Make source directory and add git information for checkout

mkdir android_dev
cd android_dev

git config --global user.name "Your Name"
git config --global user.email "someaddress@someprovider.com"

5. Download actual source and build environment
Branch names can be found at https://source.android.com/setup/start/build-numbers

repo init -u https://android.googlesource.com/platform/manifest -b android-8.1.0_r28

repo sync

make clobber

6. (OPTIONAL) Download nonfree drivers, if you skip this step vendor.img will not be built.
Matching drivers can be found at https://developers.google.com/android/drivers

wget https://dl.google.com/dl/android/aosp/google_devices-sailfish-opm4.171019.016.b1-839e6b26.tgz
wget https://dl.google.com/dl/android/aosp/qcom-sailfish-opm4.171019.016.b1-3c7f92b3.tgz

tar xvf google_devices-sailfish-opm4.171019.016.b1-839e6b26.tgz
tar xvf qcom-sailfish-opm4.171019.016.b1-3c7f92b3.tgz

./extract-google_devices-sailfish.sh
./extract-qcom-sailfish.sh

7. Prepare build options and make
Available build configurations can be found at https://source.android.com/setup/build/running

source build/envsetup.sh

lunch aosp_sailfish-userdebug

make -j8

Resulting image files can be found at out/target/product/<device_name>

 

Troubleshooting #1. If build fails with “out of heap space” error, execute the commands below and continue make

export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"
jack-admin kill-server && jack-admin start-server