Advertisement
v1ral_ITS

FORMATTING FROM TERMINAL ( notes )

Feb 7th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.57 KB | None | 0 0
  1.  80
  2. down vote
  3.    
  4. The Command-Line Way
  5.  
  6. In case you can't get your device formatted from the GUI, try this way.
  7.  
  8.    Open the Terminal (Ctrl + Alt + T)
  9.  
  10.    List your block storage devices by issuing the command lsblk
  11.    Then identify your pen drive by it's SIZE. In my case its /dev/sdb
  12.  
  13.     enter image description here
  14.  
  15.     Erase everything in the pen drive (OPTIONAL):
  16.  
  17.     sudo dd if=/dev/zero of=**/dev/sdb** bs=4k && sync  
  18.  
  19.     Replace /dev/sdb with your corresponding device. This will take some time. It will pretend to be stuck. Just be patient.
  20.  
  21.     for example:
  22.  
  23.     dd if=/dev/zero of=/dev/sdb bs=4k && sync
  24.     dd: error writing '/dev/sdb': No space left on device
  25.  
  26.     1984257+0 records in
  27.     1984256+0 records out
  28.     8127512576 bytes (8.1 GB) copied, 1236.37 s, 6.6 MB/s
  29.  
  30.     Make a new partition table in the device:
  31.  
  32.     sudo fdisk /dev/sdb
  33.  
  34.     Then press letter o to create a new empty DOS partition table.
  35.  
  36.     Make a new partition:
  37.  
  38.         Press letter n to add a new partition. You will be prompted for the size of the partition. Making a primary partition when prompted, if you are not sure.
  39.  
  40.         Then press letter w to write table to disk and exit.
  41.  
  42.     Format your new partition.
  43.         See your new partition label with the command lsblk
  44.         In my case it is /dev/sdb1
  45.  
  46.     lsblk output
  47.  
  48.         Issue the command below to format the new volume:
  49.  
  50.         sudo mkfs.vfat **/dev/sdb1**  
  51.  
  52.         Please replace /dev/sdb1 with your corresponding device.
  53.  
  54.         Eject the device:
  55.  
  56.         sudo eject /dev/sdb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement