格式化 隨身碟
將隨身碟接上電腦後
Step1 找出隨身碟是哪一個裝置
$ lsblk
or
$ sudo fdisk -l
假設是 /dev/sdd
Step2 umount 欲格式化的分區
假設是 /dev/sdd1
$ umount /dev/sdd1
Step3 格式化為 NTFS
$ sudo mkfs -t ntfs -L USB_8G -f /dev/sdd1
# -L 標籤命名為 USB_8G
# -f 快速格式化
# 格式化為 ext4
$ sudo mkfs -t ext4 /dev/sdd1
# help message
$ mkntfs -h
$ mkfs.ext4
Step4 退出隨身碟
$ sudo eject /dev/sdd
單檔超過 4G, 不能使用 fat32 需用 NTFS
將 live usb 還原成 普通的隨身碟
將隨身碟接上電腦
Step1 找出隨身碟是哪一個裝置
假設是 /dev/sdx
Step2 刪除所有分區 重新建立
$ fdisk /dev/sdx
Type d # to proceed to delete a partition
Type 1 # to select the 1st partition and press enter
Type d # to proceed to delete another partition (fdisk should automatically select the second partition)
Type n # to make a new partition
Type p # to make this partition primary and press enter
Type 1 # to make this the first partition and then press enter
Press enter to accept the default first cylinder
Press enter again to accept the default last cylinder
Type w # to write the new partition information to the USB key
Step3 格式化分區 以 fat32 為例
$ umount /dev/sdx1
$ mkfs.vfat -F 32 -n USB /dev/sdx1
# NTFS
$ sudo mkfs -t ntfs -L USB_8G -f /dev/sdx1
Step4 退出隨身碟
$ sudo eject /dev/sdd