SHARE
TWEET

NTFS fs fix to correct mounting non OS disks

a guest Sep 11th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top