Remove NOOBS from RaspberryPi sdcard
mouse 3147 · person cloud · link
Last update
2019-01-12
2019
01-12
« — »

After installing NOOBS you will have this sdcard partition table (eg. 16GB sdcard):

1
root# sfdisk -d /dev/mmcblk0
1
2
3
4
5
6
7
8
9
10
label: dos
label-id: 0x00084f9c
device: /dev/mmcblk0
unit: sectors

/dev/mmcblk0p1 : start=        8192, size=     2280871, type=e
/dev/mmcblk0p2 : start=     2289063, size=    28827225, type=5
/dev/mmcblk0p5 : start=     2293760, size=       65534, type=83
/dev/mmcblk0p6 : start=     2359296, size=      129024, type=c
/dev/mmcblk0p7 : start=     2490368, size=    28625920, type=83

and we have to create another one like this (eg. 32GB sdcard):

1
2
3
4
5
6
7
label: dos
label-id: 0x00084f9c
device: /dev/sdc
unit: sectors

/dev/sdc1 : start=        8192, size=       85405, type=c
/dev/sdc2 : start=       94208, size=    62239744, type=83

save the last output to a file sdcard.ptable and:

1
2
3
4
5
6
7
8
9
10
11
12
13
# write partition table
sfdisk /dev/sdc < sdcard.ptable

# format partitions
mkfs.vfat -v /dev/sdc1
mkfs.ext4 -m 1 -b 4096 -O ^metadata_csum -v /dev/sdc2

mkdir src dst

# copy partition 1 data
mount /dev/mmcblk0p1 src
mount /dev/sdc1      dst
rsync -avihh --stats --progress --inplace --delete --delete-before --delete-excluded src/ dst/

edit cmdline.txt and set the correct boot partition with root=PARTUUID=00084f9c-02, then:

1
2
3
4
5
6
7
umount src dst

# copy partition 2 data
mount /dev/mmcblk0p1 src
mount /dev/sdc1      dst
rsync -avihh --stats --progress --inplace --delete --delete-before --delete-excluded src/ dst/
umount src dst

and edit etc/fstab with the correct partition labels :

1
2
PARTUUID=00084f9c-01  /boot           vfat    defaults          0       2
PARTUUID=00084f9c-02  /               ext4    defaults,noatime  0       1

Note: Alternatively you can also update the NOOBS installer.


Source: Remove NOOBS and migrate Raspbian to new microSD card, Raspberry Pi 3 Model B+ Will Not Boot!,