Write the latest Raspbian image to an SD card and boot it.
Write the latest Raspbian image to a USB drive and plug it into the Pi.
Run blkid to determine the PARTUUID of the USB drive (--> ${PTUUID} )
Edit /boot/cmdline.txt and change root=PARTUUID=xxxxxxxx to match the PARTUUID of the USB drive.
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.
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.
Problem: PARTUUID des Images auf der SD ist gleich wie die PARTUUID des Images auf der SSD.
Ändern der PARTUUID der SSD:
Quelle: https://www.raspberrypi.org/forums/viewtopic.php?t=191775#p1203247
Booting from USB is easy on a Pi1, Pi2, or Pi3:
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