RaspberryPi-SD card file modification and backup

Source: Internet
Author: User
RaspberryPi: SD card file modification and backup I. preparations 1. Raspberry Pi SD card configured for startup 2. pc3 and card reader www.2cto.com in Linux 2. modify the SD card file at the beginning connect the SD card to the pc under win7, cannot be read. Use DISKGENIUS to view the modification and backup of SD card files learned by p... RaspberryPi
I. Preparation 1. startup Raspberry Pi SD card 2. Linux pc3 and card reader
Www.2cto.com 2. modify the SD card file at the beginning. I first connected the SD card to the pc under win7 and found that it could not be read. Use DISKGENIUS to view the disk status of the pc. we found that the SD card is formatted into two partitions, one Fat32 partition of 56 m and one Ext3 partition of 7.5g. For example:
The www.2cto.com Ext3 partition cannot be read under win, so you can switch to the linux system to open the SD card. Enter df-h on the linux command line and you can see that two partitions, sbd1 and sdb2, have been mounted to the pc. Next, modify the file in SD. Ls enters two partitions and finds that the 56 m partition is the boot partition, and the 7.4G partition is the system file partition of Raspberry Pi. Go to the 7.4G partition: In/home, there are pi and my new djy user folders. Enter pi, create a new tast file, input this is the test file to edit the files in RPI's SD card, and then ls finds that the file content is correct after cat is added to the test file. 3. since the SD card has been read, you can use the dd command to directly back up the SD card. The path to the df SD card is sdb1 and sdb2. Therefore, you need to back up the entire card using the path/dev/sdb. Enter the command: (write the image back to the SD card command: Sudo dd if =/home/djy/Rpi_save_3_6.img of =/dev/sdb) source is/evt/sdb both SD card, the target is the backup of the Rpi_save_3_6.img image in the/home/djy/Folder. if the disk is insufficient, you have to change the path. The size of the backed up img is 8.1 GB. However, the SD card only uses 2 GB space, but the backup is 8.1 GB, which is a waste. After checking the dd document, I used the following command: He compresses the image while copying it. Save space, and the last rpi_save_3_6.gz is only 700 MB. 4. back up and restore to the SD card and format the SD card with fdisk. 1. check the original partition. 2. delete the partition and save it. the SD card is empty. run the following command to restore the backup: decompress the backup and then write the SD card. Run the following command on the backup card of Img: dd if =/home/djy/Rpi_save_3_6.img of =/dev/sdb write card: insert the card back to Raspberry Pi to start logon: I backed up and changed the file first, so the test file disappeared. The backup is restored successfully. in the future, you can easily back up and modify the SD card.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.