1.查看SD卡信息
jetson@jetson-desktop:~$ sudo fdisk -l
Disk /dev/ram0: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram1: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram2: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram3: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram4: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram5: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram6: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram7: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram8: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram9: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram10: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram11: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram12: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram13: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram14: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/ram15: 8 MiB, 8388608 bytes, 16384 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/loop0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Disk /dev/mmcblk0: 14.7 GiB, 15758000128 bytes, 30777344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 37E09AB5-792E-4D88-85BC-EC4B0F578D4E
Device Start End Sectors Size Type
/dev/mmcblk0p1 34 29360161 29360128 14G Microsoft basic data
/dev/mmcblk0p2 29360162 29362209 2048 1M Microsoft basic data
/dev/mmcblk0p3 29362210 29374497 12288 6M Microsoft basic data
/dev/mmcblk0p4 29374498 29374657 160 80K Microsoft basic data
/dev/mmcblk0p5 29374658 29505697 131040 64M Microsoft basic data
/dev/mmcblk0p6 29505698 29507745 2048 1M Microsoft basic data
/dev/mmcblk0p7 29507746 29520033 12288 6M Microsoft basic data
/dev/mmcblk0p8 29520034 29520193 160 80K Microsoft basic data
/dev/mmcblk0p9 29520194 29651233 131040 64M Microsoft basic data
/dev/mmcblk0p10 29651234 29651617 384 192K Microsoft basic data
/dev/mmcblk0p11 29651618 29652129 512 256K Microsoft basic data
/dev/mmcblk0p12 29652130 29781153 129024 63M Microsoft basic data
/dev/mmcblk0p13 29781154 29782177 1024 512K Microsoft basic data
/dev/mmcblk0p14 29782178 29782689 512 256K Microsoft basic data
/dev/mmcblk0p15 29782690 29783201 512 256K Microsoft basic data
/dev/mmcblk0p16 29783202 29914273 131072 64M Microsoft basic data
/dev/mmcblk0p17 29914274 29918369 4096 2M Microsoft basic data
/dev/mmcblk0p18 29918370 29930657 12288 6M Microsoft basic data
/dev/mmcblk0p19 29930658 29942945 12288 6M Microsoft basic data
/dev/mmcblk0p20 29942946 29947041 4096 2M Microsoft basic data
/dev/mmcblk0p21 29947042 30561441 614400 300M Microsoft basic data
/dev/mmcblk0p22 30561442 30777310 215869 105.4M Microsoft basic data
Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mmcblk2: 250 GiB, 268435456000 bytes, 524288000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x42d96990
Device Boot Start End Sectors Size Id Type
/dev/mmcblk2p1 2048 524287999 524285952 250G 7 HPFS/NTFS/exFAT
Disk /dev/zram0: 495.4 MiB, 519446528 bytes, 126818 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/zram1: 495.4 MiB, 519446528 bytes, 126818 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/zram2: 495.4 MiB, 519446528 bytes, 126818 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/zram3: 495.4 MiB, 519446528 bytes, 126818 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
jetson@jetson-desktop:~$
2,格式化磁盘
如果已经挂载,先卸载,后格式化文件系统
jetson@jetson-desktop:/dev$ sudo umount /dev/mmcblk2p1
jetson@jetson-desktop:/dev$ sudo mkfs -t ext4 /dev/mmcblk2p1
mke2fs 1.44.1 (24-Mar-2018)
/dev/mmcblk2p1 contains a exfat file system
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 31204736 4k blocks and 7806976 inodes
Filesystem UUID: ac9a4da1-d31b-42c7-84cb-870731e281a4
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done
Writing inode tables: done
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information:
done
jetson@jetson-desktop:/dev$
3.进入挂载路径,同步文件系统到SD卡
jetson@jetson-desktop:/dev$ cd /media
jetson@jetson-desktop:/media$ cd jetson/
jetson@jetson-desktop:/media/jetson$ ls
sd
jetson@jetson-desktop:/media/jetson$ cd sd
jetson@jetson-desktop:/media/jetson/sd$ ls
lost+found
jetson@jetson-desktop:/media/jetson/sd$ sudo cp -ax / ./
[sudo] password for jetson:
jetson@jetson-desktop:/media/jetson/sd$
4.修改启动文件
jetson@jetson-desktop:/media/jetson/sd$ cd /boot/extlinux/
jetson@jetson-desktop:/boot/extlinux$ ls
extlinux.conf extlinux.conf.nv-update-extlinux-backup
jetson@jetson-desktop:/boot/extlinux$ sudo cp extlinux.conf extlinux.conf_bak
jetson@jetson-desktop:/boot/extlinux$ ls
extlinux.conf extlinux.conf_bak extlinux.conf.nv-update-extlinux-backup
jetson@jetson-desktop:/boot/extlinux$ sudo vi extlinux.conf
jetson@jetson-desktop:/boot/extlinux$
原始文件
TIMEOUT 30
DEFAULT primary
MENU TITLE L4T boot options
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1
# When testing a custom kernel, it is recommended that you create a backup of
# the original kernel and add a new entry to this file so that the device can
# fallback to the original kernel. To do this:
#
# 1, Make a backup of the original kernel
# sudo cp /boot/Image /boot/Image.backup
#
# 2, Copy your custom kernel into /boot/Image
#
# 3, Uncomment below menu setting lines for the original kernel
#
# 4, Reboot
# LABEL backup
# MENU LABEL backup kernel
# LINUX /boot/Image.backup
# INITRD /boot/initrd
# APPEND ${cbootargs}
修改后文件
TIMEOUT 30
#DEFAULT primary
#MENU TITLE L4T boot options
DEFAULT sdcard
MENU TITLE L4T boot options
LABEL sdcard
MENU LABEL primary sd card
LINUX /boot/Image
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk2p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1
# When testing a custom kernel, it is recommended that you create a backup of
# the original kernel and add a new entry to this file so that the device can
# fallback to the original kernel. To do this:
#
# 1, Make a backup of the original kernel
# sudo cp /boot/Image /boot/Image.backup
#
# 2, Copy your custom kernel into /boot/Image
#
# 3, Uncomment below menu setting lines for the original kernel
#
# 4, Reboot
# LABEL backup
# MENU LABEL backup kernel
# LINUX /boot/Image.backup
# INITRD /boot/initrd
# APPEND ${cbootargs}
5.重启后
jetson@jetson-desktop:~$ df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk2p1 117G 13G 99G 11% /
none 1.8G 0 1.8G 0% /dev
tmpfs 2.0G 88K 2.0G 1% /dev/shm
tmpfs 2.0G 20M 2.0G 1% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs 397M 128K 397M 1% /run/user/1000
/dev/mmcblk0p1 14G 13G 945M 93% /media/jetson/91016d23-01f7-4f05-9d50-4a143a689280
jetson@jetson-desktop:~$