Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
The simple way is "dd if=<device partition> of=<file on a disk large enough to hold the data> bs=<any reasonable size, even 1M is useful>"
Once the file is created you can try to mount it with "mount -t ntfs-ng <partition image file> /mnt". current mount versions should automatically create a loopback mount for the file.
The reason I put <device partition> and <partition image file> is that if you get an entire disk (rather than just the partition the filesystem is on), and that includes the partition table. At that point mounts get harder because you have to specify offsets into the file to get to the beginning of the filesystem (and that is a pain to figure out).
Once the partition image is mounted (or even before) you can work on it. I know the linux native filesystems mostly have a "fsck" that will work on image files - I'm not sure of them for NTFS, there is one, but I don't know how well it works. The nice thing about working with the file is that even if something goes badly wrong, you still have the original to work with. And if things go well and the filesystem gets repaired - you can do the same repair on the real parition.
It is just a way of CYA when things get nasty. It does mean that you have to have a filesystem that is large enough to hold the damaged data. This is the major downside- If you are trying to repair a 2 TB partition, you need one that is slightly larger than 2TB to hold all the data (reason is that copying a partition requires the data space the same size as the partition + any metadata needed for the filesystem containing the copy).
The drive is an external that was preformatted to NTFS, i just plugged it in started putting stuff there..
Now when you plug it in it recognises that the drive is there and gives you the first few folders.. but when you go in to the folders theres nothing in there. Where previously (before it broke) there was.