Skip to main content

Mounting an NTFS drive in Debian

As an ex Windows user, I still have quite a collection of music on my old NTFS drive that I don’t want to mess with Fortunately you can mount the drive in Linux and read and write to it as you would have done before Here I get the best of both worlds.
Being able to access my old Windows drives was one of the big barriers to my coming over to Linux. Once I had trawled the forums and help pages and found out I can still use ntfs to a degree I was sold. The tools won’t make Linux use ntfs, they just allow you to access them.
The process has two dependencies, ntfs-3g and libfuse 2. You will need these two packages installed before you begin the process. Ntfs-3g is a third party package that allows reading and writing to ntfs drives, which is the holy grail for me right now!
apt-get install libfuse2
apt-get install ntfs-3g
Once you have the two packages installed we can begin.
The first step is to ensure your Debian system ‘sees’ the ntfs drive. You’re not going to be able to mount anything if Linux can’t see it.
fdisk -l | grep NTFS
You should then see something like;
/dev/hda1   *           1       14387   156288421+    7  HPFS/NTFS
So now we know your ntfs drive is located on hda1. Check it isn’t mounted already by typing;
mount
There should be nothing coming up unless this isn’t the first time you are attempting this. The next step is to create a folder to mount the drive in. Linux won’t create somewhere dynamically for you. You have to tell it where you want it to put the information. I called my directory ‘windows’ but you can call it what you want.
mkdir /media/windows
mount –t ntfs-3g /dev/hda1 /media/windows
This last command mounts hda1 with ntfs-3g in the /media/windows directory. If you navigate to it now you should see your ntfs files inside. If yours works like mine did then you should also get a drive icon on the desktop. This should be labeled as whatever you called your folder in /media. You can now double click and access the files inside.
Now here is a very important step that had me stumped for ages. Unmounting the ntfs drive.
umount /dev/hda1
Notice the spelling. U-mount, not un-mount! I saw unmount whenever I read this for ages and couldn’t for the life of me figure out what was going on. So hopefully those few words are going to save you much more time than I spent trying to get the thing to work properly.
You don’t want to have to manually mount the drive every time you boot up Debian. So here is another little trick to auto mount it whenever the system starts. To do this we have to modify a file called fstab. Be very careful!!!! If you damage this file it will not boot.
Modify the file in your text editor of choice and add the line;
/dev/hda1 /media/windows ntfs-3g defaults 0 0
Save this, and now every time you boot your machine your ntfs drive will b mounted and ready to use!

Comments

Popular posts from this blog

CKA Simulator Kubernetes 1.22

  https://killer.sh Pre Setup Once you've gained access to your terminal it might be wise to spend ~1 minute to setup your environment. You could set these: alias k = kubectl                         # will already be pre-configured export do = "--dry-run=client -o yaml"     # k get pod x $do export now = "--force --grace-period 0"   # k delete pod x $now Vim To make vim use 2 spaces for a tab edit ~/.vimrc to contain: set tabstop=2 set expandtab set shiftwidth=2 More setup suggestions are in the tips section .     Question 1 | Contexts Task weight: 1%   You have access to multiple clusters from your main terminal through kubectl contexts. Write all those context names into /opt/course/1/contexts . Next write a command to display the current context into /opt/course/1/context_default_kubectl.sh , the command should use kubectl . Finally write a second command doing the same thing into /opt/course/1/context_default_no_kubectl.sh , but without the use of k

OWASP Top 10 Threats and Mitigations Exam - Single Select

Last updated 4 Aug 11 Course Title: OWASP Top 10 Threats and Mitigation Exam Questions - Single Select 1) Which of the following consequences is most likely to occur due to an injection attack? Spoofing Cross-site request forgery Denial of service   Correct Insecure direct object references 2) Your application is created using a language that does not support a clear distinction between code and data. Which vulnerability is most likely to occur in your application? Injection   Correct Insecure direct object references Failure to restrict URL access Insufficient transport layer protection 3) Which of the following scenarios is most likely to cause an injection attack? Unvalidated input is embedded in an instruction stream.   Correct Unvalidated input can be distinguished from valid instructions. A Web application does not validate a client’s access to a resource. A Web action performs an operation on behalf of the user without checking a shared sec