Raspberry Pi 3 B+

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
Ok, finally came back to test these after hacking them out the other day. Spent some time trying to break them tonight. After a little cleanup I think they are OK.

These are probably overkill, but I couldn't bring myself to post these without at least basic checks to prevent trashing the system.
  • randomizepi - changes PTUUIDs and UUIDs on the current root and boot partitions.

  • resizepi - resizes current root partition to fill drive. root partition can be resized online while mounted. Optionally takes a percentage to expand to. Optionally can be passed another unmounted partition to expand.
@wardmundy -
An additional note - I meant to go back and add a no-reboot flag to the randomizepi script. The original "find root partition" method borrowed from a raspbian script broke after changing the IDs and the script could only be run once, so I felt a reboot was warranted.

The final "find root" method seems solid before and after changes. I ran multiple times without reboot in succession, before, after and intermingled with multiple runs of resize script expanding to 50%-55%-60%-etc.

Tested on your image, Jessie-Lite, 3b+ hacked Jessie-Lite and Stretch-Lite.
 
Last edited:

Eliad

Active Member
Joined
Aug 13, 2017
Messages
619
Reaction score
127
i just tried this image on an external SSD drive with a Sabrent SATA to USB adaptor and seems to boot ok with no problem. raspi-config does not want to resize it though because is not a SD card. Is there a way to make it resize for the USB drive?
 

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405
i just tried this image on an external SSD drive with a Sabrent SATA to USB adaptor and seems to boot ok with no problem. raspi-config does not want to resize it though because is not a SD card. Is there a way to make it resize for the USB drive?
 
Last edited:

jerrm

Guru
Joined
Sep 23, 2015
Messages
838
Reaction score
405

ostridge

Guru
Joined
Jan 22, 2015
Messages
1,618
Reaction score
517
RPi3b working with root on usb HDD bootcode.txt
You can pick up the quirks values from
Code:
~# dmesg |grep usb
Code:
usb-storage.quirks=152d:0578:u dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 boot=PARTUUID=bff4f8c0-01 root=PARTUUID=bff4f8c0-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait net.ifnames=0 rootdelay=5 plymouth.enable=0
Code:
~# ll /boot/cmdline.txt
-rwxr-xr-x 1 root root 243 May 18 15:22 /boot/cmdline.txt

##optionally add a timeout file so pi waits longer.
touch /boot/timeout

ll /boot/timeout
-rwxr-xr-x 1 root root 0 Jun  5 19:21 /boot/timeout

Result as follows
Code:
~# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0         7:0    0   3.5G  0 loop /mnt/2020img
sda           8:0    0 298.1G  0 disk
|-sda1        8:1    0   476M  0 part
`-sda2        8:2    0 297.6G  0 part /
mmcblk0     179:0    0  59.5G  0 disk
|-mmcblk0p1 179:1    0   256M  0 part /boot
`-mmcblk0p2 179:2    0  59.2G  0 part /mnt/mmcblk0p2

~# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       292G   18G  260G   7% /
devtmpfs        459M     0  459M   0% /dev
tmpfs           464M     0  464M   0% /dev/shm
tmpfs           464M   47M  417M  11% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           464M     0  464M   0% /sys/fs/cgroup
/dev/mmcblk0p1  253M   54M  199M  22% /boot

~# blkid
/dev/mmcblk0p1: UUID="2E1D-65CB" TYPE="vfat" PARTUUID="7b3f6d5f-01"
/dev/mmcblk0p2: LABEL="incred2020" UUID="a7badfcc-4dab-41ec-8875-ca0efdcf9b6b" TYPE="ext4" PARTUUID="7b3f6d5f-02"
/dev/sda1: LABEL_FATBOOT="BOOT" LABEL="BOOT" UUID="1FA0-2DFD" TYPE="vfat" PARTUUID="bff4f8c0-01"
/dev/sda2: UUID="b5e6820b-26d1-4c64-b205-e2e4d7785e8e" TYPE="ext4" PARTUUID="bff4f8c0-02"
/dev/loop0: LABEL="incred2020" UUID="5dfc3d64-5f4a-40a9-92e5-ba6a4df2d415" TYPE="ext4"
/dev/mmcblk0: PTUUID="7b3f6d5f" PTTYPE="dos"
Code:
~# cat /etc/fstab
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
PARTUUID=bff4f8c0-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
Code:
~# dmesg |grep usb
[    5.187004] usb 1-1.3: new high-speed USB device number 4 using dwc_otg
[    5.397957] usb 1-1.3: New USB device found, idVendor=152d, idProduct=0578, bcdDevice=32.02
[    5.405447] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    5.413001] usb 1-1.3: Product: JMS579
[    5.420385] usb 1-1.3: Manufacturer: JMicron
[    5.427773] usb 1-1.3: SerialNumber: 330C7907
[    5.435671] usb 1-1.3: UAS is blacklisted for this device, using usb-storage instead
[    5.443109] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[    5.450999] usb-storage 1-1.3:1.0: Quirks match for vid 152d pid 0578: 1800000
[    5.458531] scsi host0: usb-storage 1-1.3:1.0
[    6.317271] Waiting for root device PARTUUID=bff4f8c0-02...
 

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,203
Latest member
frapu
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top