copy_larger_sd_card_to_smaller_sd_card
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
copy_larger_sd_card_to_smaller_sd_card [2017/01/28 22:03] – [Restore the SD Card] walkeradmin | copy_larger_sd_card_to_smaller_sd_card [2017/01/29 00:54] – walkeradmin | ||
---|---|---|---|
Line 4: | Line 4: | ||
\\ | \\ | ||
{{: | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | After initially thinking this would be a really simple task, I soon learned that no, it is not. And the worst part of it is, if you have for example a 16GB SD card, that you want to copy to another 1GB SD card, the destination card might be slightly smaller, and it will fail. This is very frustrating. If you are in this position, then read on. | ||
\\ | \\ | ||
\\ | \\ | ||
Line 226: | Line 229: | ||
\\ | \\ | ||
Note the time taken: 2306867200 bytes (2.3 GB, 2.1 GiB) copied, <color red> | Note the time taken: 2306867200 bytes (2.3 GB, 2.1 GiB) copied, <color red> | ||
+ | \\ | ||
+ | \\ | ||
+ | Remove the SD Card from the Linux PC and put it in to the Raspberry Pi. | ||
\\ | \\ | ||
\\ | \\ | ||
+ | ---- | ||
+ | ==== The Raspberry Pi ==== | ||
+ | \\ | ||
+ | If all has worked, the Raspberry Pi should now boot up. Once booted and logged in, we can check the partition sizes. | ||
+ | \\ | ||
+ | \\ | ||
+ | From the command line, use: | ||
+ | \\ | ||
+ | \\ | ||
+ | df -h | ||
+ | \\ | ||
+ | < | ||
+ | This will show the following: | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | df -h | ||
Filesystem | Filesystem | ||
/ | / | ||
Line 261: | Line 257: | ||
tmpfs | tmpfs | ||
/ | / | ||
- | + | </ | |
- | + | \\ | |
- | + | We can see from the /dev/root line above that the size is reported as 2.0G and that 880M is available. This is an 8Gb SD Card, and we need to reclaim that extra space. To do this, from the command line enter: | |
- | df -h | + | \\ |
+ | \\ | ||
+ | sudo raspi-config | ||
+ | \\ | ||
+ | \\ | ||
+ | From the menu, select No1. Expand Filesystem. | ||
+ | \\ | ||
+ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | Once completed (takes just a few seconds) Select Finish and let the Raspberry Pi reboot. | ||
+ | \\ | ||
+ | \\ | ||
+ | Now log back in and re-run the df -h command. | ||
+ | \\ | ||
+ | \\ | ||
+ | df -h | ||
+ | \\ | ||
+ | < | ||
Filesystem | Filesystem | ||
/ | / | ||
Line 273: | Line 288: | ||
tmpfs | tmpfs | ||
/ | / | ||
+ | </ | ||
+ | \\ | ||
+ | Now it can be see that the partition (/dev/root) is 7.2GB in size, with 5.9Gb free. | ||
+ | \\ | ||
+ | \\ | ||
+ | That's it, all done. | ||
+ | \\ | ||
+ | \\ | ||
+ | As a footnote, I would copy the rpi_all.img to your PC, and the you can use this to create new SD Cards using Win32 diskimager as it's a lot less hassle. But only do this once you have proved the process works. | ||
+ | \\ | ||
+ | \\ | ||
copy_larger_sd_card_to_smaller_sd_card.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1