Ads 468x60px

##EasyReadMore##

07 8月, 2017

SD 卡只剩 128MB , 還原被 linux 分割的分區

因為 sd 卡之前拿去做 linux OS

只剩下 128 MB 是因為格式是 FAT 可能用來放 BIOS 之類的

剩下的為 linux  的 EXT2 專用格式所以在 windows 看不到

所以我們只要刪除分區整合成一個

再格式化成 windows 看得懂的檔案格式即可

Step:

先在 ubuntu 下查看分區

root@ubuntu1004nb:/home/jerryhsu/0_test# fdisk -l

Disk /dev/sdb: 7945 MB, 7945060352 bytes
4 heads, 32 sectors/track, 121232 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa5aaf784

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              17        1616      102400    c  W95 FAT32 (LBA)
/dev/sdb2            1617      121232     7655424   83  Linux

真的有兩個

使用 fdisk 刪除分區
root@ubuntu1004nb:/home/jerryhsu/0_test# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p //查看分區資訊

Disk /dev/sdb: 7945 MB, 7945060352 bytes
4 heads, 32 sectors/track, 121232 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa5aaf784

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              17        1616      102400    c  W95 FAT32 (LBA)
/dev/sdb2            1617      121232     7655424   83  Linux

Command (m for help): d //刪除分區
Partition number (1-4): 1 //選第一個分區

Command (m for help): d //除資分區,但因為只剩一個 系統直接刪剩下的那個
Selected partition 2

Command (m for help): m //查看指令
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1 //新增分區
First cylinder (1-121232, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-121232, default 121232):
Using default value 121232

Command (m for help): w //將結果寫入並離開,沒執行這個的話,之前的操作都白做了
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.

完成後再插到 windows ,windows 就會說尚未格式化

再格式你要的檔案系統即可

0 意見:

張貼留言

 
Blogger Templates