LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Mounting and reading NTFS and FAT32 patitions (https://www.linuxquestions.org/questions/linux-software-2/mounting-and-reading-ntfs-and-fat32-patitions-123584/)

Forezt 12-07-2003 01:45 PM

Mounting and reading NTFS and FAT32 patitions
 
This is my second day using Fedora, and I was wondering how I could get to my windows partitions so I can acess my music and files.

I searched these forums, and I found this utility that adds NTFS support: http://linux-ntfs.sourceforge.net/index.html. I downloaded and installed the rpm. Now this is where I'm stumped: how do I actually access the partition? Do I have to use the terminal, or what. On the website with the NTFS project, it said that I had to use a mounting point, and I have no idea what this is. I know that my NTFS partition I want to get to is located at (hd0,2), and the fat32 patition is (hd0,8).

:newbie:

linux_pioneer 12-07-2003 02:03 PM

you need to find out what the partition is named, create a directory to mount it on, and mount it.

mount /partition/name /mnt/ntfs-partition/directory

hw-tph 12-07-2003 02:05 PM

Edit the file /etc/fstab. You will see entries (lines) like these ones:
Code:

/dev/hda2      /              ext3    errors=remount-ro      0      1
/dev/hda1      none            swap    sw                      0      0
.
.
.
(...etc)

Add a line for the partition you want to mount, like this (if /dev/hdb1 is a FAT32 partition):
Code:

/dev/hdb1      /mnt/win_c      vfat    user      0      0
The vfat option indicates that the partition uses the VFAT, FAT32 or FAT32X file systems. /mnt/win_c is the mountpoint, which has to be a directory. Create a mountpoint (traditionally in /mnt/) by using the mkdir command, or use a graphical file manager.

Adding an NTFS partition is similarily easy:
Code:

/dev/hdd1      /mnt/win_e    ntfs    noauto,ro,user          0      0
The "noato,ro,user" part means that it is not supposed to be mounted automatically at boot, it's readonly (you can't write to it) and users can mount the partition.

Then just use the mount command - you can mount partitions defined in /etc/fstab by just typing mount <partition> or mount <mountpoint>, like this:
mount /dev/hdb1
or...
mount /mnt/win_c
The above two commands do the exact same thing.

Håkan

ac1980 12-07-2003 10:38 PM

what you actually have to use is:
/dev/hda3 for ntfs
/dev/hda9 for vfat

for vfat, add the umask=0 option to allow any user to write to it

Forezt 02-23-2004 04:48 PM

ok, I got the partition mounted just fine, but I still can't get it so I can write the the drive as a regular user. Here's my etc/fstab


Code:

LABEL=/                /                      ext3    defaults        1 1
LABEL=/boot            /boot                  ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                  proc    defaults        0 0
none                    /dev/shm                tmpfs  defaults        0 0
/dev/hda5              swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/hda7              /mnt/stuff              vfat    defaults,user,umask=0            0 0


JROCK1980 02-23-2004 05:03 PM

Ther reason is, it is not safe to write to ntfs from Linux. But if you wish then you have to have it loaded in the kernel. This is an option that is not by default selected. You would have to build a new kernel and add that option. Then you could write to it. But be WARNED!!!!!! you can lose your ntfs drive so make sure you are backed up because a lot of crying would be involved ( At least my 200 gigs of data). But that is how you need to do it.

ac1980 02-24-2004 07:36 AM

I think none of partiotions seen by grub as (hd0,2) and (hd0,8) are shown in fstab... maybe you have an automount daemon installed?

chem1 02-24-2004 09:09 AM

DO NOT try to write to NTFS partitions. Mandrake duped me into doing this (they said its safe :-D ) and I lost my C: drive

Hope this helps...

davidbalt 02-24-2004 10:34 AM

His fstab says vfat
 
His fstab says vfat - not ntfs. I mount a vfat drive - heres the pertinent line from fstab:

/dev/hdb1 /mnt/collosus vfat defaults,mode=777

the "mode" parameter gives it full access permissions. Probably the reason you can't write to it is because it is mounted with insufficient permissions. This seems to happen a lot.

Frustratingly, I'm not sure you can rely on the permissions actually set on the files and directories on the drive if the mount permissions are not set to 777.

And a heads up for later on - you can't use all the permissions on vfat that you can use on ext. I found this out the hard way when trying to set some directories to drwx------. For instance, that particular permission can not be set (in my experience) on vfat.

jago25_98 02-24-2004 03:54 PM

fdisk /dev/hd?? > "p"

mount /dev/hd?? /mnt/foo

you probably won't need -t ntfs

ac1980 02-25-2004 01:19 PM

Quote:

I'm not sure you can rely on the permissions actually set on the files and directories on the drive
vfat has no "ownership" concept. Files have 4 attribs: system, hidden, archive, read-only. Only RO actually has an effect, so resulting possible permissions, given umask=0, are rwxrwxrwx or r-xr-xr-x


All times are GMT -5. The time now is 10:31 AM.