標籤:
將SD卡經過讀卡機插入虛擬機內,執行如下命令檢測掛在位置。
mount | grep /media
卸載SD卡
sudo umount /dev/sdxx
用“dd”命令清除MRB和分區資訊:
sudo dd if=/dev/zero of=/dev/sdx bs=10M count=1
用“fdisk”命令修改分區表
sudo fdisk /dev/sdx
按“P”鍵顯示當前分區資訊:
Command (m for help): p Disk /dev/mmcblk0: 2002 MB, 2002780160 bytes 11 heads, 10 sectors/track, 35560 cylinders Units = cylinders of 110 * 512 = 56320 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System
按“n”鍵增加一個primary分區,並確定分區尺寸
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-35560, default 1): Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-35560, default 35560): +64M
按“t”鍵,再輸入數字 6, 使新分區為FAT16檔案系統:
Command (m for help): t Selected partition 1 Hex code (type L to list codes): 6 Changed system type of partition 1 to 6 (FAT16)
按“n”鍵建立第二個分區:
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (1194-35560, default 1194): Using default value 1194 Last cylinder, +cylinders or +size{K,M,G} (1194-35560, default 35560): +1500M
按“P”鍵顯示當前分區資訊:
Command (m for help): p Device Boot Start End Blocks Id System /dev/mmcblk0p1 1 1193 65610 6 FAT16 /dev/mmcblk0p2 1194 29121 1536040 83 Linux
按“W”鍵寫入分區資訊。
Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table.
格式化並掛載分區:
sudo mkfs.msdos /dev/mmcblk0p1 # format as FAT32 you need add parameters "-F 32". if using SD card reader you need change the device name to "/dev/sdx1"
sudo mkfs.ext2 /dev/mmcblk0p2 # if using SD card reader you need change the device name to "/dev/sdx2"
sudo mount -t vfat /dev/sdx1/mnt/fat
sudo mount -t ext2 /dev/sdx2 /mnt/ext
LINUX SAMA5D3啟動SD卡製作步驟