Hellmut1956
Posts: 5
Joined: Mon Nov 17, 2014 10:29 pm

Expanding partition 2 with Jessie

Thu Feb 04, 2016 6:53 pm

I had no problems in expanding the partition 2 to the space left on the SD.

I had no problems installing the Raspbian Jessie image to a USd 1TB harddrive. The problem I ran into was that what worked for the Wheezy version of Raspi to expand partition 2 by taking note of the start position of partition 2, delete partition 2 and create a new partition 2 starting from the same start position as the original wheezy image made no problems either. Doing the same with Jessie led to my Raspi rebooting after having written the changes of the partition ending in a dark screen and a blinking cursor, underline, . on the upper left corner. The LED on the USB HD was also blinking as was the WiFi module, from EDIMAX. My Raspi is a B+, so I decided to leave the raspi running over night but nothing changed. On the Internet I found no information about expanding a partition on an external USB mass storage device for Jessie, but a couple of times the instructions I am familiar with from the Wheezy version of Raspbian. Further investigations and searches in recently released books about Linux and Raspi, books that are considered to be the "bibles" for Linux and for Raspi in german languages showed that depending of the type of partition table, MBR or GUID, different instructions have to be used.
What I could not find so far is if:
a. The type of partition table is under the "rule" of Raspian, in this case Jessie,
b. or of the USB HD.
So I have chosen the option to publish my problem here with the hope to get some tips!
Rgds
Hellmut1956

gkreidl
Posts: 6139
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Expanding partition 2 with Jessie

Thu Feb 04, 2016 9:56 pm

Installing the image to a HDD is not a good solution at all, because the first (fat) boot partition has to be on the SD card and is useless on the HDD. This is the way to go:
viewtopic.php?f=29&t=44177
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Hellmut1956
Posts: 5
Joined: Mon Nov 17, 2014 10:29 pm

Re: Expanding partition 2 with Jessie

Thu Feb 04, 2016 10:53 pm

@gkreidel: Kofler recommends it and Mell group here even says explicitly that copying just those files required to the root partition on the microSD cards results in having a HD and not a flash memory that has a high number but limited number of write cycles to be exposed to those operations. Mell even states that the HD even results in a more stable environment.
As I wrote, I had the Jessie image on the HDD already working but with the partition size limited to that resulting from copying the Jessie image on it! For this to work you have to copy certain files and edit the cmdline.txt file:

"The file /boot/cmdline.txt specifies the location of the root filesystem. "

All you have to change there is the entry for "root=..." to the HDD, i.e. sdap2 indicating the second partition in the filesystem created by copying the Jessie Image file to the HDD. Workds great!

I will continue researching what Mett writes in his series, I have given the link to "Part 6" where a HDD is being added. I will start tomorrow focusing on how he gets started and gets the GUID. Looks from a first scan of the article that my guess about the partition table not being BRM but GUID puts me on the right track! He even mentions how to use NTFS formated drive and not the FAT32! Great explorations tasks for tomorrow!

Nevertheless, thy for replying!

gkreidl
Posts: 6139
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Expanding partition 2 with Jessie

Thu Feb 04, 2016 11:07 pm

I run all my Pis from a root file system on HDD and yes, they are much more stable and run faster than from SD card. Only the boot partition is used from the SD card afterwards and is only written to, when you get a kernel or firmware update or change one of the configuration files.

But the way shown in the posting I referenced is much better suited in my view to create a root fs on HDD.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: Expanding partition 2 with Jessie

Thu Feb 04, 2016 11:20 pm

I've done similar with a Pi SD card but working in a Windows environment using a free partition managing tool and had great results at the time. The only part I never sussed was increasing the size of the /root partition as the partition manager wouldn't allow it, so I went via an alternative route of initially installing the OS on a 32GB card and expanding the file system on the Pi to occupy the full card, then copied the partition across. This left just the /boot partition required on the SD card (with an appropriate change to cmdline.txt), so allowed for a much smaller card to be used thus freeing up the 32GB card for use elsewhere.

IIRC, speed gains were of the order of a factor of 3 for small file reads/writes making the OS much more responsive, plus I only needed a 256MB SD card that was too small to be of any use for anything else for the /boot partition. Win-win.

A recent attempt at doing the same with a new 32GB Sandisk Ultra microSD card and the same hard drive led to a performance loss by a factor of 3 due to the modern card having vastly superior small read/write speeds compared to the mechanical hard drive, so I've left the OS on the microSD card as I'd rather that than take a massive performance hit.

Modern SD/microSD cards of decent brand/model purchased from reputable suppliers (to avoid the risk of buying a cheap sub-standard copy) are far more reliable than the stories that have slipped into fokelore would have you believe. Per hour of uptime, I've had far more HDD failures than SD card failures over the past few years, so I'm reluctant to entirely trust spinners either.

Keeping a regularly updated backup of your /root partition on the hard drive would protect you from such a failure. Just make sure you back up that backup incase the spinner dies on you too. :lol:
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Expanding partition 2 with Jessie

Sat Feb 06, 2016 2:35 pm

Kofler recommends it and Mell group here even says explicitly that copying just those files required...
The link you gave shows a blog from August 2014. Most blogs don't even give a date, so at least that one is better than those. Be aware that the Raspberry Pi had a major distro upgrade last year based on Debian Jessie (using systemd instead of SysVinit). Although that post might not be affected by this upgrade, it is not always correct to rely on old blogs. Any articles that are Linux general topics may also be incorrect when applied to the Raspberry Pi, particularly when discussing the boot process as the Pi has a rather different one to the PC.

Hellmut1956
Posts: 5
Joined: Mon Nov 17, 2014 10:29 pm

Re: Expanding partition 2 with Jessie

Sun Feb 07, 2016 4:30 pm

I have seen that what was given in that blog did not work and I could not find anything dated after the Raspbian Jessie version was published!

gkreidl
Posts: 6139
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Expanding partition 2 with Jessie

Sun Feb 07, 2016 7:07 pm

Hellmut1956 wrote:I have seen that what was given in that blog did not work and I could not find anything dated after the Raspbian Jessie version was published!
Why don't you follow the link I posted in my first answer?
This is a method that works on any OS version, thousands of people have used it (have a look at the number of views).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

Return to “Advanced users”