element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog Breathe New Life into that old Raspberry Pi 2
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 7 Nov 2016 10:29 PM Date Created
  • Views 1098 views
  • Likes 6 likes
  • Comments 3 comments
Related
Recommended
  • rpi3
  • raspbian.
  • rpi2
  • respberry

Breathe New Life into that old Raspberry Pi 2

Former Member
Former Member
7 Nov 2016

My Raspberry Pi 2 was mostly disused, running a couple of Seti@Home threads.  It is out of date and the speed was always rather slow compared to the other machines in my home.  Some of it is because 1GB RAM is anemic in 2016 but some of it is because a MicroSD is a very slow storage device, even with tuning Linux parameters in configuration files like /etc/fstab.

 

So, I decided to do something about it.  I have a 120GB USB 2 backup drive that is also a bit out of date, having been replaced with a slim USB 3 1TB drive.  But, it is still a cheetah when compared with a MicroSD.  Being cheap, I decided to simply use the 120GB drive rather than buy a new one.

 

Strategy: roughly, Transfer system disk from SD card to hard disk - eLinux.org .  I would have liked to followed the RPi3 strategy of booting directly from the USB drive (https://www.raspberrypi.org/blog/pi-3-booting-part-i-usb-mass-storage-boot/ ).  Unfortunately, that would become yet another "project" in itself due to RPi2 off-the-shelf firmware limitations (fixed, hopefully: https://github.com/raspberrypi/documentation/blob/master/hardware/raspberrypi/bootmodes/README.md ).  However, getting everything but /boot functions onto a USB drive will still be quite satisfying.

 

First, whether you are going with RPi2 or RPi3, keep in mind that a USB drive needs power.  The RPi2, as I learned the hard way [image], does not have sufficient power for write-stability.  Get a powered USB hub if the drive does not have a power chord.  In my case, I have one of those USB Y-cables from the Pleistocene epoch so the green connector (data) plugs into the RPi2 and the blue/black connector (juice) plugs into one of my Intel PCs (yes, cheating to save money and space in my home office).

 

Okay, here we go:

 

1. Make sure that the USB drive is ready for copying the entire MicroSD-based root partition [/].  The drive is going to be reborn.  Did you save all the data that you want to keep somewhere else?

 

2. The simplest preparation approach is to install `gparted` if you do not already have it (Just as good as Windows Partition Magick and it is donation-ware! ).  On my desktop, `gparted` appears in the desktop menu under the category "Preferences" (Why not "System Tools"?).  Go figure.

 

3. Launch `gparted` from the menu.  Be careful because it is potentially dangerous but so is `gpart, `fdisk`, and `sfdisk`.  I am recommending this GUI to avoid manual calculations and minimize the chance for mishap.  Enter your `sudo` password.

 

4. From the drive list in the upper right, select the drive that Raspbian mapped your USB drive to.  Mine was /dev/sda.  Be careful.

 

5. Related to the selected drive, you will see a list of partitions and 0 or more line(s) stating "unallocated".  Click on Device > Create Partition Table.  If you see a no-can-do message that 1 or more partitions are "currently active", unmount them: Right click on a mounted partition and select "Unmount".  Once all of the partitions of this drive are unmounted, proceed to re-create the partition table:

 

See the "WARNING....." pop-up.

Select "msdos" and click "Apply".

 

6. The result of the previous step is a single line "unallocated".  Now, create a single ext4 partition which is a little bit larger than the MicroSD /dev/mmcblk0p2 partition:

 

Right click on the line "unallocated".

Select "New".

Enter the size in MiB.  My Jessie Pixel /dev/mmcblk0p2 partition was 14.9 so I entered 16.  We will enlarge this later.

Optionally, you can label the partition (E.g. "raspbian-slash").

Click "Add".

 

7. Commit changes by clicking on the little green check mark near the top of the GUI.  Exit from `gparted` when all of the commit screens are done.

 

8. Going to do a partition copy with `dd`.  Windows and Mac users have an equivalent tool.  For the sake of the example, I assume that your target partition is specified as /dev/sda1:

 

sudo dd bs=4M conv=noerror if=/dev/mmcblk0p2 of=/dev/sda1

 

# Go have a pint and kick back.  This is going to take a bit.

 

10. The previous step concluded perfectly.  Re-launch `gparted`.  Select the drive and the new partition.  Right click and select "Resize/Move".  You can extend the partition to the end of the disk.  Exit `gparted`.

 

11. sudo  YOUR-FAVORITE-EDITOR  /boot/cmdline.txt

Change "/dev/mmcblk0p2" to "/dev/sda1", assuming again that /dev/sda1 is the new partition on the USB drive.

Save and exit.

 

12. Disconnect the USB drive and reconnect it.  Note where it is mounted, say, /minister/silly-walks/usbdrive.

 

13. sudo  YOUR-FAVORITE-EDITOR  /minister/silly-walks/usbdrive/etc/fstab

Change "/dev/mmcblk0p2" to "/dev/sda1", assuming again that /dev/sda1 is the new partition on the USB drive.

Save and exit.

 

14. Reboot

 

Yes, I followed this to the letter.  My RPi2 is considerably faster in terms of disk I/O and, therefore, storage-dependent applications (all of them?).

 

Fallback: Power off.  Take out the MicroSD.  Edit it somewhere to reverse steps 11 and 13.  Re-insert MicroSD.  Power on.  You are back to where you were.  What went wrong?

 

Questions/comments?

  • Sign in to reply

Top Comments

  • Former Member
    Former Member over 8 years ago +1
    I added an "rpi3" tag because I believe that this procedure will work for an RPi3 as well as the RPi2. I would guess that booting from and accessing faster storage, bypassing MicroSD, will give the RPi3…
  • Former Member
    Former Member over 7 years ago in reply to mp2100

    Using a flash drive would probably be fine, depending on the quality of the flash drive.  Faster than MicroSD, yes.  Look at consumer reviews, especially comments concerning longevity.

     

    If it were me, I would be looking at a mSATA card that stacks on top of the Raspberry Pi or a purely external SSD or mSATA drive.  I just happened to have an unused small-ish portable drive to deploy.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mp2100
    mp2100 over 7 years ago

    Another good tutorial, thanks.  What do you think about using a USB thumb drive instead?  Assuming it's USB 2.0 speed, 480 Mb/s (60 MB/sec) would also give a speed boost and simplify the cabling.  "Thumb" drives are the size of a USB A connector these days.

     

    I realized a couple of my RPi are using SD class 4 as boot/run "discs".  I looked up the speed, it's a little embarrassing, 4 MB/sec.  Time for an update on those SD cards.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 8 years ago

    I added an "rpi3" tag because I believe that this procedure will work for an RPi3 as well as the RPi2.  I would guess that booting from and accessing faster storage, bypassing MicroSD, will give the RPi3 a performance boost too.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube