RonR wrote: ↑Thu Jul 25, 2019 8:55 pm
Is anyone other than you running a Raspberry Pi with /home on a separate filesystem?

I may be the only one.
usb-boot uses rsync to copy the contents of /dev/mmcblk0 to /dev/sdX (only when replicating the SD card to the USB device). If you know of an rsync option that will assist your situation, please let know.
AFAIK `rsync` limits its traversal to a single filesystem. To copy two filesystems, it would need to be run twice.
It's been a while since I modified a Pi to boot from USB (/boot on SD) but IIRC I used `dd` to copy the SD card to a larger USB drive, used `gparted` to adjust partition sizes and adjusted /boot/cmdline.txt and /etc/fstab for the new layout.
Give me some details of what you're doing, why others might be doing the same thing, and any suggestions and I'll take a look.
My process for standing up a Pi is presently:
- copy downloaded image to micro-SD card.
- create ssh and wpa_supplicant.conf if configuring a headless sytem that depends on WiFi
- boot and go through initial configuration (resize, hostname, language, localization etc.)
- remove micro-SD card and put in another PC.
- use `gparted` to resize the root partition and create a home partition
- move home directories to new filesystem.
- adjust /etc/fstab to mount the new home partition
- put micro-SD card back in the Pi and proceed with whatever I'm doing (and make sure I didn't forget anything.)
That's my initial setup. I had an idle SSD which seemed to work OK with the Pi (with UAS disabled) so I decided to move / and /home to it. I ran your script and it left me witrh a working system (Yay!) but with /home still on the micro-SD card. (boo.) I proceded to get this sorted and in the process learned a bit about `gparted` and how the Pi boots.

At present my setup is
Code: Select all
hbarta@nova:~ $ cat /etc/fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
PARTUUID=98408e28-02 / ext4 defaults,noatime 0 1
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
PARTUUID=98408e28-03 /home ext4 defaults,noatime 0 1
oak:/export/share /mnt/share nfs noauto,x-systemd.automount,x-systemd.device-timeout=10,x-systemd.idle-timeout=1min 0 0
# previous /home and / mounts, set to noauto so they don't mount
/dev/mmcblk0p3 /mnt/sd-home ext4 defaults,noauto,noatime 0 1
/dev/mmcblk0p2 /mnt/sd-rootfs ext4 defaults,noauto,noatime 0 1
/dev/sda1 /mnt/ssd-boot vfat defaults,noauto 0 0
Code: Select all
hbarta@nova:~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 19G 5.6G 12G 33% /
devtmpfs 1.8G 0 1.8G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 8.7M 1.9G 1% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/mmcblk0p1 253M 40M 214M 16% /boot
/dev/sda3 215G 682M 203G 1% /home
tmpfs 391M 0 391M 0% /run/user/1000
/dev/mmcblk0p3 18G 656M 16G 4% /mnt/sd-home
hbarta@nova:~ $
The "why" is just to partition system files from personal files. I've done that on most of my systems for decades now. (I don't always do that on single purpose systems such as those on Pi Zeroes, chromebooks and so on.)
Feel free to ask about this and/or point out anyuthing that youy think is going to give me problems.