Roadsunshine Provides OEM And ODM Services for A Variety of Sportswear.

How to Create a Custom Reduced Raspberry Pie Image

Step 1: preparation

First, turn off raspberry, unplug the power plug, and then remove the SD card.

The next step will be on Linux PC (or Linux live system).

Please do not use raspberry PI in subsequent steps! I tried several times, but failed all the time.

Start your Linux machine, start the console window, and then use

sudo gparted

Start GParted, then insert it into the SD card reader (and, of course, the SD card) and refresh the GParted device list (Ctrl R).

Select your SD card from the drop-down menu in the upper right corner. Note the device path for later use (for example, / dev / SDD). In the next steps, we will reduce the master data partition. This will save us a lot of time for the next step. therefore

Right click the ext4 partition available in the list

Select resize / move

In the resize / move window, drag and drop the zone to the desired size, or just manually enter the new size. In my case, it's 4096mib

Hit resize / move and apply all actions buttons

GParted will now resize the partition.

For other steps, note the specific data of the partition:

Right click the partition SDD1 in the list and click info

Note the size, first sector, last sector and total sector

Repeat the steps for partition sdd2

For example:



Now you have resized the partition and some important values for subsequent steps.

Step 2: save data

In this step, we will create a complete backup SD card.

Wait a minute, you said we wanted to create a smaller card!?

That's right, but before we can shrink the backup, we need a backup that can shrink.

So open a new console window and type:

su root

(if not already created, enter the root password, enter "sudo passwd" and set a root password)

(Su it's OK without 'root')

If you want to create a backup on an external device, you must first install it. If you use a Linux live system and want to backup on an internal (Windows) hard disk, you must also install it.

First create an installation point:

mkdir -p /mnt/backup

Use GParted to get the name of the backup target device:

Refresh with Ctrl R

Determine the hard drive menu from the device drop-down list. You used a known size in step 1. Select it and note the device path of the desired partition (for example, / dev / sda1).

To install your backup hard drive:

mount /dev/sda1 /mnt/backup

Your backup space is now accessible in / MNT / backup.

Let's start and backup

dd if=/dev/sdd of=/mnt/backup/rpi.img bs=1M

This command copies the entire SD card to our backup hard drive and creates an image file as large as the SD card.

Please be patient, this process may take a long time! Have coffee or some beer, maybe two

Step 3: create a custom picture

Finally, we can start creating custom images.

To do this, we create an image disk with the same properties as the backup image but different sizes.

Remember strange numbers, such as the Department you should pay attention to? Now we need them!

Just make sure you use the fdisk tool to get the specific data of the backup image you created:

fdisk -l -u=cylinders /mnt/backup/rpi.img

The output shall be as follows:

Units = sectors of 1 * 512 bytes = 512 bytes

And so on

For the next step, we need (they should be the same for each SD card, but to ensure discovery!):

heads = 255

sectors/track = 63

Unit = 512 bytes

Now we must do some mathematical operations. Don't panic. It's easy.

Heads * sectors / track * units = bytes per column

255 * 63 * 512 = 8225280 = "note that this value is important!

The structure of the image is as follows:

4 MB unallocated space for master boot record (MBR)

63mb FAT32 boot partition

4096mb (for data partitioning)

Add up this space and you'll get 4163mb

With this information, we can calculate the required number of cylinders.

It's just (image size in bytes) / (bytes per cylinder) =) cylinder

The image size is 4163 MB. To convert it to bytes, we multiply the term by 1024 twice.

4163 * 1024 * 1024 = 4365221888 bytes

(image size in bytes) / (bytes per cylinder) = cylinder

4365221888 / 8225280 = 530, 71 = 531 cylinder

Now create a blank image by:

dd if=/dev/zero of=/mnt/backup/5gb.img bs=8225280 count=531

The result is a new blank image w size of 4163mb

Step 4: create a zone

There are no partitions or anything else in the created image. So let's create some partitions yes!

fdisk -u -C531 -S63 -H255 /mnt/backup/5gb.img

Now the tool fdisk creates a new boot table and asks you to take further steps. Now, you need to get the sector data from GParted.

e extended

Using default value 1

Selected partition 1

Youve just created the first boot partition. Now the data partition

e extended

Using default value 2

Just ignore the default sector size and use the sector size obtained from GParted!

Now enter "W" and press enter to finish!

The partition table has been altered

WARNING If you have created or modified any DOS 6.x

partitions please see the fdisk manual page for additional information.

Syncing disks

Step 5: copy data

Now let's talk about where you can transfer data to a blank image.

Just from the boot partition to the new boot partition, use the following command:

dd if=/mnt/backup/rpi.img of=/mnt/backup/5gb.img bs=512 count=129024 skip=8192 seek=8192


We skip the first 4MB (MBR!) on the image, start with 8192 blocks from the first partition, copy the next 129024 sector, and stop at the last sector (137215) of the partition.

We perform the same operation again, but for the second partition:

dd if=/mnt/backup/rpi.img of=/mnt/backup/5gb.img bs=512 count=8388608 skip=137216 seek=137216

Count = total sectors

Skip and find first sector

Done! Now you will get a new 4.4 gib image that you can use for all SD cards.

Copy it to the SD card, just like all other PI and boot images

In this description, I used a 64gib SD card. I have tested new custom images on 16 gib, 8 gib and 32 gib cards. Everything is fine. On the first boot, run "sudo raspi config" and resize the file system.

Feel free to use this instruction to make changes or sell. I don't care: D

Inspired by this how to: German directive

How to Create a Custom Reduced Raspberry Pie Image 1

recommended articles
Info Center Cases FAQ
Standard and custom length low PIM cables can be shipped on the same dayPasternack, a brand of infinity electronics and an industry-leading supplier of RF, microwave and millimeter wave products, enables customers to obtain more diversified connector...
With the development of science and technology, automotive light source technology is undergoing changes. At present, LED light source has gradually become the first choice for more high-end vehicle lamps. OSRAM, as a leading brand of global automoti...
Step 1: prepareMaterials required:Copper clad plateTamiya paintMr.hobby.inc mr.surfacer 1200 block printing350MW laser tubeBOMPan head socket head cap screw m3 x 6Sandpaper: 400 CW, 800 CW, 1600 CWRequired equipmentElectric ironDrilling machineRequir...
SpringSoft, Inc. has released two new products to overcome the growing challenges of custom chip design. Based on the professional ability of using its own Laker system to realize automatic customized design, SpringSoft published Laker custom row pla...
Each custom cable assembly project has a unique set of requirements that require specific types of components to achieve * good performance under specific circumstances. For example, even if the price and performance requirements may be met, cables w...
When it comes to "no deal", people's first reaction is Yijia technology. The company that adheres to the Internet boutique strategy of "only being the best Android flagship" brought a surprise in November. Yijia 6T officially met you. As a new genera...
On April 20, AGM officially released a new model of IP customized series, AGM X3 CIA customized version. This special derivative is called "agent mobile phone". CIA is the main organization in mission impossible. In reality, it is also the popular CI...
Sony electronics launches es receiver specially designed for the next generation of home entertainmentThe new model meets various custom installation requirementsDallas, October. May 15, 2015 / / PRNewswire / - (CEDIA booth 3701) - Sony Electronics a...
Teconnectivity (TE), a global leader in connectivity and sensing, recently announced the launch of customized antenna solutions. The wireless industry has the following needs: increasing the complexity of antennas and realizing the miniaturization of...
Some beginners always think that communication protocol is a very complex knowledge. They think it deeply, so they don't know how to learn it. At the same time, some readers occasionally ask questions about the serial port custom communication protoc...
no data

Contact person: Stanley Zhang

Tel : +86 13751812734

Email : Stanley@roadsunshine.com

Address : Room 712, A2 Jiefeng E-Commerce BlvdNo.50 Juyuan St, Shicha Rd, Baiyun Dist,

Guangzhou, China

Contact Sales at ROADSUNSHINE .
Call Us

+ 86 13751812734

Sound experience     |    follow3    |    Sound experience    |   follow4  |  
Copyright ©2012-2023 Guangzhou Road Sunshine Sports Wear co.,Ltd | All Rights Reserved Design by www. roadsunshine.com - lifisher.com | Sitemap
Customer service