Mounting an NTFS partition with a Linux Live CD
I have recently been in the very unfortunate position of needing to get data off a deceased Linux system, which was running a software RAID-1 Linux LVM.
Normally, getting data off such drives is fairly simple – you put them in another build and copy the data. However for a long list of reasons, this wasn’t possible. In short, the only option I had available was to boot the dead system of a Live CD of Fedora 9 and then attempt to get the data onto a USB hard drive.
The problem was, my external USB hard drive was NTFS and couldn’t be made FAT as the files I needed are all larger than 32GB (which is the largest size a FAT partition can get to, let alone file size, which I think is around 2GB). The large files are VMWare disks, if you’re wondering.
The disk needed to remain visible to Windows, so I could load up the VMWare sessions ASAP, which meant NTFS it needed to stay.
So here’s the “howto” bit, in keeping with my policy of blogging anything I think I might need to remember in future.
How do you mount an NTFS permission in read/write, within Linux?
Firstly, you need ntfs-3g installed. If you don’t have it, you should be able to grab it with up2date, yum, apt-get etc. On a RedHat variant, like Fedora, you can see if it’s there as such:
{please note: all as root}
rpm -q ntfs-3g
Fortunately, I can see it happily sitting there: ntfs-3g-1.2506.1.fc.x86_64.
Now all I needed to do was mount it. This is just the mount command, with a few extra options:
Firstly, find the drive:
fdisk -l (that’s a lowercase L btw)
Here I see I am after /dev/sdb1
Now I just make a folder to mount it to:
mkdir /media/ntfs
mount /dev/sdb1 /media/ntfs -t ntfs-3g -rw -o umask=0000
If that tells you the drive wasn’t shut down cleanly (and it probably will) and you need to tell Windows to let go kindly, just repeat as follows:
mount /dev/sdb1 /media/ntfs/ -t ntfs-3g -rw -o force
There. Pretty simple. I can now copy my precious files to my NTFS drive and use them on my Windows PC, while I wait for Linux to reinstall on the crashed box.
on February 1st, 2010 at 1:05 am
Great information thank you for your blog.