Advertisement
Guest User

NTFS fs fix to correct mounting non OS disks

a guest
Sep 11th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.53 KB | None | 0 0
  1. #!/bin/bash
  2. if [ -n "$1" ]
  3. then
  4. DEV=$1
  5. echo "$DEV"
  6. else
  7. DEV='/dev/sda5'
  8. echo "$DEV"
  9. fi
  10. ###################################
  11. #try
  12. #sudo mount -t ntfs-3g -o remove_hiberfile /dev/sda2 /mnt
  13. #to mount Windows hibernated partition
  14. ###################################
  15. if grep -qs $DEV /proc/mounts; then
  16.     echo "It's mounted."
  17.     echo "try umount $DEV"
  18.     sudo umount $DEV
  19.     echo "try re-run script ;)"
  20. else
  21.     echo "It's not mounted."
  22.     sudo ntfsfix -d $DEV
  23.     echo "now try reboot system or re-mount $DEV ;)"
  24. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement