Format SD card for Jetson. (For swap file ?)

This post http://jetsonhacks.com/2015/02/07/format-sd-card-ext4-nvidia-jetson-tk1/ suggests how to format an sd card for jetson. However this does not work for me with errors about super blocks when I try to mount it.

sudo mkfs.ext4 /dev/mmcblk1p1
sudo mount  /dev/mmcblk1p1 /mnt/sdcard
mount: wrong fs type, bad option, bad superblock on /dev/mmcblk1p1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
dmesg | tail 
[ 2641.277942] [EXFAT] unmounted successfully
[ 2717.496630] JBD2: no valid journal superblock found
[ 2717.496640] EXT4-fs (mmcblk1p1): error loading journal
[ 2725.797717] JBD2: no valid journal superblock found
[ 2725.797730] EXT4-fs (mmcblk1p1): error loading journal
[ 3015.976113] JBD2: no valid journal superblock found
[ 3015.976122] EXT4-fs (mmcblk1p1): error loading journal
[ 3037.919438] JBD2: no valid journal superblock found
[ 3037.919451] EXT4-fs (mmcblk1p1): error loading journal
[ 3044.491154] vgaarb: this pci device is not a vga device

Is this the correct procedure?

A straight formatted SD card works fine but it would not work for a swap file. I guess its being handled as removable media.

For a mountable file system, using sudo, this works for me to format/mount an SD card as ext4:

mkfs.ext4 /dev/mmcblk1p1
mount -t ext4 /dev/mmcblk1p1 /mnt

Note that ext4 is not used for swap and cannot be set as swap…it’s just a regular file system. One could instead either create a file within that swap using “dd” and loopback in such a way that the file is treated as swap; or one could simply mkswap instead of ext4. If what you want is JUST swap:

mkswap /dev/mmcblk1p1
swapon /dev/mmcblk1p1

Thanks, I could not get a data partition of type ext4 to work. However added a swap partition and managed to set that up as swap.