Wednesday, February 19, 2014

Changing SSH port

Changing the SSH port was needed to able to set the router to allow port forwarding.

Using Vi:

  1. I removed the comment sign (#) in front of the line "Port"
  2. I also removed the comment sign in front the "PermitRootLogin yes" (this is not good practice so I'll have to change it in the future but for now I wanted to make sure I didn't lock myself out)
Tested using Putty and this worked.

Great !

Sunday, February 16, 2014

Resizing the partitions - attempt 2 (successful)

Since the previous didn't work out that well, I started searching again. Found this link and decided to follow the steps described there.

The main difference is that Jan suggests to make the new partition "extended" instead of "primary" which seems to make sense (at least from a semantic point of view, at the moment not really sure what this means in Linux terms).



After this initial step, the advice from Jan tells us to create a logical partition within the extended partition. Not really sure why I need this, but I kind of trust Jan already :).


Ending with a write and reboot (same error message as in attempt 1 uh oh) , I hold my breath and ... The Raspberry reboots, success !

One step remains, apparently we still need to resize the filesystem for real (not really sure what we did so far but let's listen to Jan).



On my to-do list following things to research:

  1. difference between primary and extended partition
  2. the necessity of a logical partition
  3. the necessity of the resize2fs




Resizing the partitions - Attempt 1

Before you read any further, I just want to mention that this does not end successfully. Follow the steps at your own risk :).

I followed the instruction in this article.


  1. I started with fdisk where I learned that I should add -l to list the partition table :
  2. Continue following the steps in the article, which tell me I should note the number 1740800
  3. Next I should remove the last two partitions. I accidentally removed the first partition. This is not a problem, just press q and start over again. Contrary to the explanation, I started by removing partition 5 and then removed partition 2 (after I found out I can no longer remove partition 5 after I removed partition 2 probably because they overlap ??) 
  4. Trying to create a new partition works until I have to enter the last sector. At that point in get an error "Value out of range". So I just tried going with the default value. After which I pressed w and got following error : "Re-reading the partition table failed.: Device or resource busy"
  5. Let's ignore the error and just reboot the Raspberry. reboot
  6. Woops, the Raspberry turns off but not back on, something is wrong ... Unplugging, also doesn't work. This means back to square one Getting Started





Getting started

I've downloaded the Arch Linux image from the official Raspberry Pi page : raspberrypi downloads (I downloaded the 2014-01-06 version).

I followed the instructions on : archlinuxarm.org. To summarize:


  1. Download win32diskimager (sourceforge) and extract to a folder
  2. Insert your empty SD card and launch the Win32DiskImager.exe. Get the image by extracting the zip you've downloaded from the official Raspberry Pi page. Copy the location into the field "Image File". Select the location of your SD card as the "Device".
  3. Press "Write" and wait.
  4. When finished plug the SD card into the Raspberry and wait for 30 seconds to be sure that everything is loaded correctly.
  5. I found my ip address through the configuration screen of my router. I used this to connect to my Raspberry over SSH