Install and run an existing image from piDrive

At this point you can connect the piDrive to the Raspberry Pi, insert the SD card and power up. On my setup everything worked and the Raspi was booting just fine. Because my server backup image was 64GB, the piDrive still uses only half of its capacity. Finally, I wanted to utilize all the available space on the piDrive, the method using raspi-config doesn’t work with the piDrive because it’s connected by USB.

128GB disk drive with only 64GB used.

128GB disk drive with only 64GB used.

When connected to you Raspberry Pi type the following command to start fdisk:
sudo fdisk /dev/sda
Then press p and enter to see the partitions. There should only be 2. What we’re going to do now is delete the Linux partition, but before we do this, we make a note of the start position for the linux partition sda2. Press d and then when prompted type 2 and then hit enter. This will delete the partition. (Don’t worry, nothing will be deleted 😉 )

Now we’re going to create a new partition, and make it large enough for the OS to occupy the full space available on the piDrive. To do this type n to create a new partition, when prompted to give the partition type, press p for primary. Then it will as for a partition number, press 2 and hit enter.

You will be asked for a first sector, set this as the start of partition 2 as noted earlier. In my case this as 122880 but this is likely to be different for you.

After this it will ask for an end position, hit enter to use the default which is end of disk. Now type w to commit the changes. You will see a message about the Kernel, just ignore this. Type the following to reboot:
sudo reboot
Once your Raspberry Pi has rebooted, we need to resize the partition. To do this type the following command:
sudo resize2fs /dev/sda2
Be patient, this will take some time. Once it’s done reboot again. Then type:
df -h

Now using the full 128GB.

Now using the full 128GB.

This will show the partitions and the space, you’ll see the full piDrive has all the space available now. That’s it, result!

Operational. That’s where you end up when connecting to raspberrypi.nerdcamp.net 😎

piDrive piDrive

Step by step guide to install Raspian OS to an USB drive

7 thoughts on “Install and run an existing image from piDrive

  1. Hallo Michael,
    besten Dank für deine Unterstützung.
    Bei mir hat der Installer , wie so bei vielen Nutzern des PiDrives, nicht funktioniert.
    Aber mit deiner Beschreibung hat es geklappt.

    Dan hatte ich noch ein Problem mit einem Wackelkontakt des USB-Verbinders.

    Jetzt läuft alles bestens

  2. Hi,
    I receive my PiDrive without PiDrive to USB cable ((( Can you send me photo or instruction how can I made this cable. I need to know how connect PiDrive pins to USB
    Thank you.

  3. Der Raspberry 3 bietet ja die Möglichkeit, direkt (also ohne eine MicroSD-Card) von USB zu booten (https://www.raspberrypi.org/blog/pi-3-booting-part-i-usb-mass-storage-boot/). Das funktioniert super.
    Seit 2017-04-10 bietet Raspbian die Möglichkeit, ein jungfräuliches Image direkt (wie von einem MicroSD gewohnt) auf das USB-Drive zu schreiben und sofort davon zu booten (https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md). Der langwierige Copy-Prozess von MicroSD auf USB-Drive kann entfallen.

  4. Hello. Thanks for this tutorial ! I’d like to transfer my Volumio sd card to my pidrive. My volumio sd card contains 3 partitions :
    – the Fat32 to boot
    – /dev/mmcblk0p2 (approximatly 2.3Go)
    – /dev/mmcblk0p3 (approximatly 27Go)

    But this is the /boot/cmdline.txt content :
    dwc_otg.lpm_enable=0 dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0x3 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 imgpart=/dev/mmcblk0p2 imgfile=/volumio_current.sqsh elevator=noop rootwait smsc95xx.turbo_mode=N bootdelay=5

    I’ve got a imgpart but no “root=/dev/mmcblk0p2″…
    What must I do on the /boot/cmdline.txt file ?
    Thanks a lot !!!

    • Transfer the SD card image and then try if it is booting. Below in the comments Herbert said that at least on a Pi3 you can directly boot from USB MSD without having a SD cards.

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments will be moderated! Spam deleted immediately!
Before you submit form:
Human test by Not Captcha