简介

  1. # 首先插入 SD卡
  2. zhou@zhou:~$ dmesg
  3. [ 2496.933595] sdb: sdb1 sdb2
  4. [ 2497.023206] sd 3:0:0:0: [sdb] Attached SCSI removable disk
  5. # 切换到 root
  6. zhou@zhou:~$ sudo -i
  7. [sudo] password for zhou:
  8. #
  9. root@zhou:~# fdisk -l
  10. Device Boot Start End Sectors Size Id Type
  11. /dev/sdb1 1024 21503 20480 10M c W95 FAT32 (LBA)
  12. /dev/sdb2 21504 8410111 8388608 4G 83 Linux
  13. # 可以看到有两个分区 sdb1 sdb2

删除分区

  1. root@zhou:~# fdisk /dev/sdb
  2. Command (m for help): d
  3. Partition number (1,2, default 2): 2
  4. Partition 2 has been deleted.
  5. Command (m for help): d
  6. Selected partition 1
  7. Partition 1 has been deleted.
  8. # 最后保存
  9. Command (m for help): w
  10. The partition table has been altered.
  11. Calling ioctl() to re-read partition table.
  12. Syncing disks.
  13. # 查看sdb的分区
  14. # 现在只有 sdb了
  15. root@zhou:~# ls -al /dev | grep sdb
  16. brw-rw---- 1 root disk 8, 16 Feb 25 15:26 sdb

参考资料