LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how can i read NTFS on ubuntu (https://www.linuxquestions.org/questions/linux-newbie-8/how-can-i-read-ntfs-on-ubuntu-442905/)

Sigudian 05-08-2006 05:20 PM

how can i read NTFS on ubuntu
 
i know debian based linux(and probably more or all) can read NTFS but im having problems accessing mine. since you see me posting this topic here you know im a :newbie: , but plis help me anyway.

what ive tried
opening disk manager, and tried to enable it from there, whit no luck

opening command line and looking for info, whit no luck

and my final question is if i can get linux to read/write NTFS file systems whit a patch or something, and were do i get that?

if you need any more info from me to help just ask, Thanks in advance

pljvaldez 05-08-2006 05:28 PM

http://easylinux.info/wiki/Ubuntu#Ho...s_to_read_only

Be sure to only mount read only. Write access to NTFS is still experimental and you might damage your windows install by trying to write to it. You've been warned....

pwc101 05-08-2006 05:53 PM

I don't use a Debian-based system, but I'm assuming some of this is fairly generic to all systems. If someone knows differently, please feel free to correct me. I don't know how much of a newbie you are, so I apologise if some of this sounds condescending.

[This has mainly been lifted form www.linux-ntfs.org]

You can check what kind of filesystems your installation can support by typing (copying) the following command into your favourite terminal:
Code:

cat /proc/filesystems
You should see something like this
Code:

    nodev  rootfs
    nodev  bdev
    nodev  proc
    nodev  sockfs
    nodev  tmpfs
    nodev  shm
    nodev  pipefs
            ext3
            ext2
    nodev  ramfs
    nodev  devpts
            ntfs

The last line there is the important one: it tells you your system can support ntfs (it may not be the last line when you run the command - make sure you check the list carefully). If you see ntfs in the output of the above command, then all you need to do is tell your system to recognise the fact you have another drive you'd like it to access. To do this you need to "mount" the drive. (The man page for the mount command is an invaluable tool at this point, so I'd recommend you have a look at it at some point (type man mount into a terminal)).

This is accomplished using the mount command from within a terminal, and is only executable as root. To switch from a user to root in a terminal, type
Code:

su -
whereafter you will be prompted for your root's password. Once you've entered it, you can mount the drive.

To mount the drive, you need to find out what the system calls you ntfs drive. To do this type
Code:

/sbin/fdisk -l
as root into your terminal. The output should look something like this:
Code:

Disk /dev/hda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1        767    6160896    7  HPFS/NTFS
/dev/hda2            768        780      104422+  83  Linux
/dev/hda3            781        2434    13285755  8e  Linux LVM

Disk /dev/hdb: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hdb1  *          1      19929  160079661    7  HPFS/NTFS

although it will differ depending on how many drives/partitions you have. In order to mount your ntfs partition/drive, identify which of the ones listed in that output is the one you're looking to mount (in my case, /dev/hda1 and /dev/hdb are my windows partition/drives). Next thing to do is to choose where you want to mount your drive. More often than not, there's a folder called mnt in your root directory (/mnt). I mount all my ntfs drives in here, and in order to do this you need to first create a folder into which you can mount the drives/partitions. As root, type
Code:

mkdir /mnt/windows_drive
Once you've done that, you can issue the command to mount the ntfs paritions, using the /dev/hdX from the output of /sbin/fdisk -l:
Code:

mount /dev/hdX /mnt/windows_drive -t ntfs -r -o umask=0222
(where hdX is the partition/drive you're looking to mount). Once you've done this, you should be able to change directory into /mnt/windows_drive as have a nose around. The -r and -o flags in the mount command make the /mnt/windows_drive directory read-only, since the ability to write to ntfs partitions is largely experimental in linux at the moment.

In order to get your ntfs drive/partition to mount automagically at boot, you need to edit your fstab file. So, as root, open up /etc/fstab using your favourite text editor (nedit, gedit, vi(m), emacs etc.) (at this point, it may be worth making a backup of your fstab file by copying the original (cp /etc/fstab /etc/fstab.old)). Once you've opened up your fstab file, add something like this to it:
Code:

/dev/hdX              /mnt/windows_drive            ntfs    ro,umask=0222  0 0
(remember to replace hdX with your drive/partition). This basically turns the mount command you've just issued in the terminal into something which Linux does each time you boot your computer (you may notice that there are some similarities: ro, umask=0222 etc.) The umask=0222 allows users to access and read from the drive, but no-one can write to it. If I remember rightly, you have to leave an empty line at the end of the fstab file.

farslayer 05-08-2006 10:43 PM

The Ubuntuguide has a section dedicated to NTFS.. it may help you see how Ubuntu handles NTFS partitions..

http://ubuntuguide.org/#mountunmountntfs

pretty simple really..

Code:

Q: How to mount/unmount Windows partitions (NTFS) manually, and allow all users to read only?

  1. Read General Notes
  2. Read How to list partition tables?
  3. e.g. Assumed that /dev/hda1 is the location of Windows partition (NTFS)
          Local mount folder: /media/windows

  4. To mount Windows partition

      sudo mkdir /media/windows
      sudo mount /dev/hda1 /media/windows/ -t ntfs -o nls=utf8,umask=0222

  5. To unmount Windows partition

      sudo umount /media/windows/

Q: How to mount Windows partitions (NTFS) on boot-up, and allow all users to read only?

  etc.......


Sigudian 05-09-2006 08:57 AM

Quote:

Originally Posted by pljvaldez
(url was removed, go to original post to get it)

Be sure to only mount read only. Write access to NTFS is still experimental and you might damage your windows install by trying to write to it. You've been warned....

thank you thank you thank you thank you


and thanks to all other who posted, but i got it the first post, im starting to get a hang of linux :D




for the record (so no one get mad) its not an exact quote because i was not allowed to post URL's... yet


All times are GMT -5. The time now is 06:25 PM.