Copiying necessary files from the old Image

  • Plug your USB stick containing your image in a free USB port on your RevPi Connect.
  • Start your RevPi Connect. It is important that you don’t interrupt this first start as now a few files are generated, like for example the SSH key

IMPORTANT – when logging onto Jessie for the first time, there are a few features that differ from the normal log-in process. Please read the following steps carefully.

    • When logging onto your freshly downloaded image for the first time as user “pi”, the password is still “raspberry”. Immediately after logging on, the password will be then returned to the one it had upon delivery of your RevPi Connect. Please note: The keyboard layout is german by default. You may need to exchange the “y” with an “z” if you are using an english keyboard.
    • Enter the serial number (2) and the MAC address (1) of your RevPi Connect. Both are to be found on the front panel of your RevPi Connect.

  • re

MAC address, (2) serial number
Your device number will now be shown.

Should the sticker with your password no longer be available, note down this password now.
  • Shut down your module by entering the following command: “sudo shutdown”
  • Re-start your module by disconnecting it from the power supply, waiting a couple of seconds and then reconnecting to the power supply.
  • Log-in with your log-in data
  • Enter the following command: “lsblk”. It enables you to check whether your USB stick has been recognised by your RevPi Connect. Normally, the USB stick is shown as the “sda” drive.
  • Enter the following command: “sudo mount /dev/sda /mnt”. It enables you to mount your USB stick in the directory hierarchy.
  • Enter the following command: ”sudo losetup /dev/loop0 /mnt/Name of the image”. It enables you to create a loop device (a virtual drive) where you can access your old image.
  • Enter the following command: ”sudo partprobe /dev/loop0″. It means you can readout the kernel of the partition table of the loop device.

Please note: In the following steps we will mount the image under “/tmp/alt”. You can obviously mount it in another place. To do so, you must adapt the path accordingly.

  • Enter the following command: “mkdir /tmp/alt”. It enables you to mount the image in the “/tmp/alt” directory.
  • Enter the following commands one after another: “sudo mount -o ro /dev/loop0p2 /tmp/alt”, “sudo mount -o ro /dev/loop0p1 /tmp/alt/boot”. It enable you to mount both partitions of the image.

Files to configure the system can be found on partition 1. Own files and programmes that you have created yourself can be found in partition 2.

You can now copy your files from your old image. Our ones for example look like this: “sudo cp -p /tmp/alt/etc/dhcpcd.conf /etc/dhcpcd.conf”.

As we don’t know which files are important for you here, we’ve put together a list of the files that we always save:

  • Authorisations and certifications:
    • /etc/ssh/ssh_host_*
    • /home/pi/.ssh/*
  • Network settings:
    • /etc/dhcpcd.conf
    • /etc/wpa_supplicant/wpa_supplicant.conf
  • Boot options:
    • /boot/config.txt
    • /boot/cmdline.tx
    • Software lists:
    • Write lists of all the installed programmes: dpkg -l>Dateiname.txt
    • Lists of all the programmes you have installed yourself: /var/log/apt/history.log

You’ve found everything you need? Great. Now a little sprint to the finish. The directories that we have gone to great pains to mount now have to be dismounted. But you’ve already had enough practice which is why we’ll go through it quickly.

  • Enter the following commands one after another: “sudo umount /tmp/alt/bootsudo”, “sudo umount /tmp/alt”, “sudo losetup -d /dev/loop0”, “sudo umount /mnt”, “sudo delpart /dev/loop0 1”, “sudo delpart /dev/loop0 2”.

Done and dusted. And now we’d like to wish you lots of fun with the new Image.