Any a good description of the Raspberry Pi boot process and the disk partition structure?
What is stored on each partition (and why)?
Does the RPI boot from the SD card (sector zero) or the firmware reads from the disk structure?
I assume that being NOOBS created copying a few files under any O/S, the RPI firmware knows about (high level) MS-DOS disk structure and find it's way into the SD memory.
I want to clone a good SD card to a larger SD card to extend the available space.
Can I create and partition a new SD and just DD each partition to the new device? Which partitions are needed?
The 'linux'
partition on the new device be larger than the original and then extend the disk space?
Maybe clone into a new card and extend only the last partition (p6) to use the available space, but I don't want to use a try and error method, will like to know how and why.
Why my question?
Most RPI SD cards have two (fdisk) partitions, perhaps when installed from a .img
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 155647 153600 75M c W95 FAT32 (LBA)
/dev/mmcblk0p2 157696 15351807 15194112 7.3G 83 Linux
However I have one with as many as 6 partitions, this is the structure inherited from NOOBS.
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 8192 1675781 833795 e W95 FAT16 (LBA)
/dev/mmcblk0p2 1679360 15499263 6909952 85 Linux extended
/dev/mmcblk0p3 15499264 15564799 32768 83 Linux
/dev/mmcblk0p5 1687552 1810431 61440 c W95 FAT32 (LBA)
/dev/mmcblk0p6 1818624 15499263 6840320 83 Linux
I think something is wrong with this picture. Two W95 partitions?
I will like to clone only the right partitions to a new card. I have to much work on this running SD to start all over again! (BTW I have a few good backups).
Some notes.
Partition p1
-rwxr-xr-x 1 root root 18K 2015-03-09 04:45 bootcode.bin
-rwxr-xr-x 1 root root 2.2K 2015-03-09 04:45 INSTRUCTIONS-README.txt
drwxr-xr-x 4 root root 32K 2015-03-09 04:45 os
...
-rwxr-xr-x 1 root root 542K 2015-03-09 04:45 recovery.elf
-rwxr-xr-x 1 root root 0 2015-03-09 04:45 RECOVERY_FILES_DO_NOT_EDIT
-rwxr-xr-x 1 root root 2.1M 2015-03-09 04:45 recovery.img
-rwxr-xr-x 1 root root 20M 2015-03-09 04:45 recovery.rfs
-rwxr-xr-x 1 root root 9.5K 2015-03-09 04:45 riscos-boot.bin
drwxr-xr-x 2 root root 8.0K 2015-12-05 18:13 System Volume Information
Partition p2
mount: /dev/mmcblk0p2: can't read superblock
Partition p3
-rw-r--r-- 1 root root 274 1969-12-31 19:18 installed_os.json
drwx------ 2 root root 12K 1969-12-31 19:00 lost+found
-rw-r--r-- 1 root root 86 1969-12-31 19:18 noobs.conf
Partition p4
does not exist.
Partition p5
:
-rwxr-xr-x 1 root root 9.7K 2015-12-01 20:17 bcm2708-rpi-b.dtb
...
-rwxr-xr-x 1 root root 18K 2015-12-01 20:17 bootcode.bin
-rwxr-xr-x 1 root root 120 1979-12-31 19:00 cmdline.txt
-rwxr-xr-x 1 root root 1.5K 2015-11-23 09:01 config.txt
-rwxr-xr-x 1 root root 19K 2015-10-14 05:43 COPYING.linux
...
-rwxr-xr-x 1 root root 9.5K 2015-12-01 20:17 fixup_x.dat
-rwxr-xr-x 1 root root 137 2015-02-16 09:57 issue.txt
-rwxr-xr-x 1 root root 3.9M 2015-12-01 20:17 kernel7.img
...
-rwxr-xr-x 1 root root 591K 2015-12-01 20:17 start_cd.elf
...
Partition p6
(the real raspbian partition)
drwxr-xr-x 2 root root 4.0K 2015-07-28 21:40 bin
drwxr-xr-x 2 root root 4.0K 2015-02-15 09:09 boot
drwxr-xr-x 119 root root 4.0K 2015-12-23 15:36 etc
drwxr-xr-x 4 root root 4.0K 2015-12-19 20:53 home
drwxr-xr-x 15 root root 4.0K 2015-12-20 22:08 lib
drwx------ 2 root root 16K 2015-02-15 06:21 lost+found
....
drwxr-xr-x 12 root root 4.0K 2015-11-04 15:18 var
p2
has) an extended partition - in this case a "Linux" one and it is a container for the remaining ones needed above 4 - and there is more than one way to organise those 'logical' partitions inside the extended one.