PDA

View Full Version : mounting my ntfs partitions



spacelobsters
29th June 2006, 07:57 PM
My simple request is for an explanation of how to use the information provided from the fdisk list to make two new entries in the fstab file, please include explanations of what each column within the new fstab line means. Thanks!!!

/sbin/fdisk -l


Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda2 * 2 24321 195350400 f W95 Ext'd (LBA)
/dev/sda5 2 24321 195350368+ 7 HPFS/NTFS

Disk /dev/sdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2376 19085188+ 83 Linux
/dev/sdb2 2508 24321 175220955 f W95 Ext'd (LBA)
/dev/sdb3 2377 2507 1052257+ 82 Linux swap / Solaris
/dev/sdb5 2508 24321 175220923+ 7 HPFS/NTFS

Partition table entries are not in disk order

Here we have the fstab file (unchanged)

LABEL=/ / ext3 defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-sda31 swap swap defaults 0 0

Effie04
29th June 2006, 09:19 PM
Hello


fstab Explenation:

the first field is the block device (partiotion in our case) that you want to mount
the second field is the folder that a partition will mounted upon, its called a mount point (well, everything in linux is a file)

the third fields defines the file system the partition is formatted with.
the fourth field is mount options: defaults means the partiotion will be mounted with the rw dev async and some more options, you can add various options, you can get more info with man:
write man 5 fstab at a terminal

the last two fields are dump frequency and fsck order, which commonly wont used so use 0 0

add 2 line to your fstab, something like this:
use tab for a space between the fields


/dev/sda5 /mnt/win1 ntfs defaults,umask=0222 0 0
/dev/sdb5 /mnt/win2 ntfs defaults,umask=0222 0 0

umask=0222 means that the partitions will be read-only
/mnt/win1 and 2 are folder you have already created.
i add iocharset=utf8 to the mount options to be able to read my local language characters, you might need this maybe...
one last thing , to have ntfs support you have to install an ntfs kernel module (do yum install kmod-ntfs)

Effie04
29th June 2006, 09:24 PM
fstab Explenation:

the first field is the block device (partiotion in our case) that you want to mount
the second field is the folder that a partition will mounted upon, its called a mount point (well, everything in linux is a file)

the third fields defines the file system the partition is formatted with.
the fourth field is mount options: defaults means the partiotion will be mounted with the rw dev async and some more options, you can add various options, you can get more info with man:
write man 5 fstab at a terminal

the last two fields are dump frequency and fsck order, which commonly wont used so use 0 0

add 2 line to your fstab, something like this:
use tab for a space between the fields


/dev/sda5 /mnt/win1 ntfs defaults,umask=0222 0 0
/dev/sdb5 /mnt/win2 ntfs defaults,umask=0222 0 0

umask=0222 means that the partitions will be read-only
/mnt/win1 and 2 are folder you have already created.
i add iocharset=utf8 to the mount options to be able to read my local language characters, you might need this maybe...

spacelobsters
29th June 2006, 11:12 PM
Thanks alot, very helpful explanation.

I've already installed the kernel-module-ntfs using a tutorial online.

One more question pops to mind, why is it you chose to have the umask to read only? Would i be able to change this value to write to the partition too, since i am only storing files that had been accessed by my windows installation. btw the windows installation is now obsolete and have replaced it with linux.

Another thing i guess i could do is change the ntfs partion into ext3 but that is only another thought.

Effie04
29th June 2006, 11:55 PM
Why using read-only on ntfs ? because ntfs is closed code unlike fat32.
ntfs writing support is something that is not 100% stable or supported.
you could enable write mode, but im not sure how good it will function.

if you dont use windows on your computer i dont see a reason to use ntfs...