mschlenstedt / Loxberry

Current stable Branch is: *** Please see Releases *** Current developer Branch is: *** master ***
Apache License 2.0
76 stars 27 forks source link

Boot from SSD/USB #971

Closed christianTF closed 5 months ago

christianTF commented 5 years ago

Problem: PARTUUID des Images auf der SD ist gleich wie die PARTUUID des Images auf der SSD.

Ändern der PARTUUID der SSD:

export PTUUID=11223344

fdisk /dev/sda <<EOF > /dev/null
p
x
i
0x${PTUUID}
r
p
w
EOF

Quelle: https://www.raspberrypi.org/forums/viewtopic.php?t=191775#p1203247

Booting from USB is easy on a Pi1, Pi2, or Pi3:

  1. Write the latest Raspbian image to an SD card and boot it.
  2. Write the latest Raspbian image to a USB drive and plug it into the Pi.
  3. Run blkid to determine the PARTUUID of the USB drive (--> ${PTUUID} )
  4. Edit /boot/cmdline.txt and change root=PARTUUID=xxxxxxxx to match the PARTUUID of the USB drive.
  5. Reboot. The Pi should be running from the USB drive.

If you ever need to boot from a different USB drive or from the SD card, it's necessary to FIRST mount the boot partition of the SD card (/dev/mmcblk0p1) and edit the boot partition's cmdline.txt so that root=PARTUUID=xxxxxxxx matches the device you wish to boot from.

Quelle: https://www.raspberrypi.org/forums/viewtopic.php?t=193157#p1210713

Resize der SSD funktioniert mit der Funktion des Pi nicht

8

You have to first resize the partition with the following steps:

parted /dev/sda to enter the prompt "(parted)" resizepart 1 to resize the partition 1 -0 resizes it to the end of the disk. - indicates that it should count from the end of the disk, not the start. This makes -0 the last sector of the disk - which is suitable when you want to make it as big as possible. Step 4: quit to exit parted The file system meta information needs to indicate the size of disk, and resize2fs updates this. Thus, after expanding, run resize2fs /dev/sda1.

It's highly recommended to do this in either single user mode / recovery mode, or with the file system mounted in read only mode. You can mount it read only by mount -o remount,ro /dev/sda1.

Extending is possible to do with filesystem in RW-mode, but it increases chances of data loss. As this is a VM, and you can easily make a backup, doing it with the volume mounted RW may make sense.

Addendum: run commands as root for desired effect.

Quelle: https://askubuntu.com/a/958145/761119

Getestet mit

mschlenstedt commented 2 years ago

https://www.youtube.com/watch?v=WolddCfWP5I

mschlenstedt commented 5 months ago

Geht mit DietPi.