简介
# 首先插入 SD卡
zhou@zhou:~$ dmesg
[ 2496.933595] sdb: sdb1 sdb2
[ 2497.023206] sd 3:0:0:0: [sdb] Attached SCSI removable disk
# 切换到 root
zhou@zhou:~$ sudo -i
[sudo] password for zhou:
#
root@zhou:~# fdisk -l
Device Boot Start End Sectors Size Id Type
/dev/sdb1 1024 21503 20480 10M c W95 FAT32 (LBA)
/dev/sdb2 21504 8410111 8388608 4G 83 Linux
# 可以看到有两个分区 sdb1 sdb2
删除分区
root@zhou:~# fdisk /dev/sdb
Command (m for help): d
Partition number (1,2, default 2): 2
Partition 2 has been deleted.
Command (m for help): d
Selected partition 1
Partition 1 has been deleted.
# 最后保存
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
# 查看sdb的分区
# 现在只有 sdb了
root@zhou:~# ls -al /dev | grep sdb
brw-rw---- 1 root disk 8, 16 Feb 25 15:26 sdb
参考资料