Advertisement
metalx1000

Create and Fix a Fake 1TB FLASH Drive

Nov 1st, 2015
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #create vfat filesystem file
  2. mkdosfs -C temp_file 1000000000
  3.  
  4. #check file size
  5. ls -lh temp_file #fake size
  6. ls -sh #real Size
  7.  
  8. #get real size in KB
  9. ls -s temp_file
  10.  
  11. #As ROOT (Not SUDO)
  12. head -c [size_from_above]K temp_file > /dev/sdc1
  13. #umount and remount
  14.  
  15. #label Drive
  16. sudo mlabel -i /dev/sdc1 ::"1TB DRIVE"
  17. #OR
  18. sudo dosfslabel /dev/sdc1 "1TB DRIVE"
  19.  
  20. #filelight is a good visual of disk usage
  21. #df -h will show it was a TB
  22. #Gparted is not fooled
  23. #fdisk is not fooled
  24.  
  25. #use fdisk and mkfs.vfat to recreate partition to fix
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement