1

Topic: gparted pi sdcard won't boot

I am running gparted on a pi4.

I wanted to clone an existing, working bootable micro-sd card.  Original card is 32GB, destination card is 128GB.

I deleted all partitions on destination card.

I then copy and pasted the bootfs and rootfs partitions from the source card to the destination card.

The operation completed successfully.

I then changed the flag on the bootfs partition to iba.

I then attempted to boot from the new card.  Doesn't work.

Below is the output of the copy operation described above.

What am I missing here?  This should just work, right?

GParted 1.2.0

configuration --enable-libparted-dmraid --enable-online-resize

libparted 3.4

========================================
Device:    /dev/mmcblk0
Model:    SD 00000
Serial:   
Sector size:    512
Total sectors:    62518272

Heads:    255
Sectors/track:    2
Cylinders:    122584

Partition table:    msdos

Partition    Type    Start    End    Flags    Partition Name    File System    Label    Mount Point
/dev/mmcblk0p1    Primary    8192    532479    boot, lba        fat32    BOOTFS    /boot
/dev/mmcblk0p2    Primary    532480    62518271            ext4    rootfs    /

========================================
Device:    /dev/sda
Model:    Generic MassStorageClass
Serial:   
Sector size:    512
Total sectors:    62333952

Heads:    255
Sectors/track:    2
Cylinders:    122223

Partition table:    msdos

Partition    Type    Start    End    Flags    Partition Name    File System    Label    Mount Point
/dev/sda1    Primary    8192    532479    boot, lba        fat32    bootfs   
/dev/sda2    Primary    532480    62333951            ext4    rootfs   

========================================
Device:    /dev/sdd
Model:    Generic MassStorageClass
Serial:   
Sector size:    512
Total sectors:    250347520

Heads:    255
Sectors/track:    2
Cylinders:    490877

Partition table:    msdos

Partition    Type    Start    End    Flags    Partition Name    File System    Label    Mount Point

========================================
Copy /dev/sda1 to /dev/sdd (start at 4.00 MiB)  00:00:18    ( SUCCESS )
        
calibrate /dev/sda1  00:00:01    ( SUCCESS )
        
path: /dev/sda1 (partition)
start: 8192
end: 532479
size: 524288 (256.00 MiB)
check file system on /dev/sda1 for errors and (if possible) fix them  00:00:00    ( SUCCESS )
        
fsck.fat -a -w -v '/dev/sda1'  00:00:00    ( SUCCESS )
        
fsck.fat 4.2 (2021-01-31)
Checking we can access the last sector of the filesystem
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
65:01/00
Not automatically fixing this.
Boot sector contents:
System ID "mkfs.fat"
Media byte 0xf8 (hard disk)
512 bytes per logical sector
512 bytes per cluster
32 reserved sectors
First FAT starts at byte 16384 (sector 32)
2 FATs, 32 bit entries
2064896 bytes per FAT (= 4033 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 4146176 (sector 8098)
516190 data clusters (264289280 bytes)
32 sectors/track, 64 heads
8192 hidden sectors
524288 sectors total
Reclaiming unconnected clusters.
Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
Automatically removing dirty bit.
Checking free cluster summary.
/dev/sda1: 430 files, 104512/516190 clusters
create empty partition  00:00:00    ( SUCCESS )
        
path: /dev/sdd1 (partition)
start: 8192
end: 532479
size: 524288 (256.00 MiB)
set partition type on /dev/sdd1  00:00:01    ( SUCCESS )
        
new partition type: fat32
copy file system from /dev/sda1 to /dev/sdd1  00:00:16    ( SUCCESS )
        
using internal algorithm
copy 256.00 MiB
finding optimal block size
        
copy 16.00 MiB using a block size of 1.00 MiB  00:00:01    ( SUCCESS )
        
16.00 MiB of 16.00 MiB copied
1.1178 seconds
copy 16.00 MiB using a block size of 2.00 MiB  00:00:01    ( SUCCESS )
        
16.00 MiB of 16.00 MiB copied
1.17953 seconds
copy 16.00 MiB using a block size of 4.00 MiB  00:00:01    ( SUCCESS )
        
16.00 MiB of 16.00 MiB copied
1.21591 seconds
copy 16.00 MiB using a block size of 8.00 MiB  00:00:01    ( SUCCESS )
        
16.00 MiB of 16.00 MiB copied
1.19084 seconds
copy 16.00 MiB using a block size of 16.00 MiB  00:00:02    ( SUCCESS )
        
16.00 MiB of 16.00 MiB copied
1.1488 seconds
optimal block size is 1.00 MiB
copy 176.00 MiB using a block size of 1.00 MiB  00:00:10    ( SUCCESS )
        
176.00 MiB of 176.00 MiB copied
256.00 MiB (268435456 B) copied

========================================
Copy /dev/sda2 to /dev/sdd (start at 260.00 MiB)  00:08:57    ( SUCCESS )
        
calibrate /dev/sda2  00:00:00    ( SUCCESS )
        
path: /dev/sda2 (partition)
start: 532480
end: 62333951
size: 61801472 (29.47 GiB)
check file system on /dev/sda2 for errors and (if possible) fix them  00:00:06    ( SUCCESS )
        
e2fsck -f -y -v -C 0 '/dev/sda2'  00:00:06    ( SUCCESS )
        
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

205864 inodes used (10.65%, out of 1933312)
501 non-contiguous files (0.2%)
57 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 185229/72
3632440 blocks used (47.02%, out of 7725184)
0 bad blocks
1 large file

166765 regular files
18000 directories
8 character device files
0 block device files
0 fifos
1766 links
21045 symbolic links (20510 fast symbolic links)
37 sockets
------------
207621 files
e2fsck 1.46.2 (28-Feb-2021)
create empty partition  00:00:00    ( SUCCESS )
        
path: /dev/sdd2 (partition)
start: 532480
end: 62334975
size: 61802496 (29.47 GiB)
set partition type on /dev/sdd2  00:00:01    ( SUCCESS )
        
new partition type: ext4
copy file system from /dev/sda2 to /dev/sdd2  00:08:43    ( SUCCESS )
        
e2image -ra -p '/dev/sda2' '/dev/sdd2'  00:08:43    ( SUCCESS )
        
e2image 1.46.2 (28-Feb-2021)
Scanning inodes...
Copied 3632072 / 3632072 blocks (100%) in 00:08:18 at 28.49 MB/s s
check file system on /dev/sdd2 for errors and (if possible) fix them  00:00:06    ( SUCCESS )
        
e2fsck -f -y -v -C 0 '/dev/sdd2'  00:00:06    ( SUCCESS )
        
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

205864 inodes used (10.65%, out of 1933312)
501 non-contiguous files (0.2%)
57 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 185229/72
3632440 blocks used (47.02%, out of 7725184)
0 bad blocks
1 large file

166765 regular files
18000 directories
8 character device files
0 block device files
0 fifos
1766 links
21045 symbolic links (20510 fast symbolic links)
37 sockets
------------
207621 files
e2fsck 1.46.2 (28-Feb-2021)
grow file system to fill the partition  00:00:01    ( SUCCESS )
        
resize2fs -p '/dev/sdd2'  00:00:01    ( SUCCESS )
        
Resizing the filesystem on /dev/sdd2 to 7725312 (4k) blocks.
The filesystem on /dev/sdd2 is now 7725312 (4k) blocks long.

resize2fs 1.46.2 (28-Feb-2021)

2

Re: gparted pi sdcard won't boot

Something you can try is to delete the first 20-30 MiB in the destination media using the dd command (writing zero's). This often helps. Then, you make a new partition table and proceed to the copy operations.
Another idea can be to clone the source card to the destination one with dd and check if the copy boots. Then, you can expand the (copied) system partition to take the space you want: the entire free space or a part of it, in the case you want to leave space for other partitions. Just take into account that the MBR schema supports up to 4 primary partitions, or 3 primary and 1 extended with more logical partitions inside.

*** It is highly recommended to backup any important files before doing resize/move operations. ***