JetPack3.1 creating problems with SD Card

Some terminology will help. Partitions have basically two categories: Older BIOS partitions (often called legacy compatibility on a motherboard CMOS setting), and the newer GPT partition (used with UEFI systems…this is what newer systems use as a replacement to a BIOS on a desktop system, it is more flexible and does not have the same partition size and count limits to make use of larger hard drives).

gdisk was meant to work with GPT partitions, fdisk was meant to work with older BIOS style partitions. Depending on what you have, such as an SD card, it is possible it has been formatted for either GPT or BIOS. I don’t know if Jetsons handle BIOS partitions well or not, but it is a safe bet to use GPT. Thus if your SD card is BIOS and not GPT, perhaps it will work, but it won’t hurt to make it GPT if not.

What goes on a partition is either a file system (if it is to be used as a mountable partition) or a subdivision of other partitions (mainly from the BIOS days when there was an extended partition able to hold up to four other partitions). The following will erase the current SD card and provide a known working setup…be sure you name the right device when you do this, it would be a disaster if you did this with the wrong device:

# Refer to the device as a whole, not the partition, so perhaps "mmcblk1", but NOT "mmcblk1p1":
sudo -s
gdisk /dev/mmcblk1
# you can use "h" to get help.
p
# This will list partitions...you're in interactive mode. Delete each partition, probably just "1":
d 1
# confirm, "p" and see if the partition is gone:
p
# Note that this is not yet saved, you could exit without save still ("q").
# Now a new partition to become partition 1 (mmcblk1p1):
n
1
# <b>Hit enter key twice to accept defaults</b> and the whole device will be used.
# You now need to mark the partition type as hex code <b>8300</b> ("Linux filesystem").
# Verify again, "p", should show partition 1. If correct, write and quit:
w
# Verify "y".
# Now you can format the <i>partition</i>:
# try this first...if it gives error try the second one...
mkfs.ext4 -O ^metadata_csum,^64bit /dev/mmcblk1p1
# Do this one if error:
mkfs.ext4 /dev/mmcblk1p1
# Verify:
gdisk -l /dev/mmcblk1p1
# Should show this:
Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present

At this point you have a valid GPT partition scheme. On the Jetson it would be “/dev/mmcblk1p1”. Device name will differ on other computers, but will still be a single device with one partition.

FYI, this message from your previous list says very likely the disk was corrupt, probably things will work after repartitioning the SD and formatting it:

Warning! Secondary partition table overlaps the last partition by
33 blocks!

A note about the mkfs.ext4 options “-O ^metadata_csum,^64bit”: Not all PCs will support those options…if your PC does support these options, then this will ensure the options are not used. These options are for large 64 bit file systems, and although a Jetson and the Linux kernel could handle these, the U-Boot boot loader cannot…U-Boot would not find a valid partition with metadata_csum or 64bit, so Linux would never get a chance to load. Most of the time you will not see those options by default, but they are starting to appear more often as time goes by. Formatting the card directly on a Jetson implies you don’t need to remove those options, this is more for formatting from a newer Linux PC distribution.