LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mounting a partition as a folder on home diretory (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-a-partition-as-a-folder-on-home-diretory-730278/)

manuleka 06-02-2009 08:00 PM

mounting a partition as a folder on home diretory
 
i've got an unused partition which i'd like to mount as a folder

can someone give me a quick instruction on this?

it is a NTFS partition (empty) and i would like to have it permanently mounted as a diretory on home/user

i know i'd have to also edit fstab but clueless on what to add/edit on the file

thanks for any help

jamescondron 06-02-2009 08:22 PM

Okay, thats simple enough, you'll need to know the device name for your partition, then it should be something like this:

Code:

/dev/sda3      /home/mountpoint          ntfs    defaults        0      2
To get the device name, you want
Code:

fdisk -l
it should (hopefully) be obvious which is right, though you can try them all if you want ;)

To ensure you can mount ntfs, you want to:
Code:

grep ntfs /proc/filesystems
If nothing is returned, you don't have support. In which case, just install the driver ;)

manuleka 06-02-2009 08:31 PM

Quote:

Originally Posted by jamescondron (Post 3560998)
Okay, thats simple enough, you'll need to know the device name for your partition, then it should be something like this:

Code:

/dev/sda3      /home/mountpoint          ntfs    defaults        0      2

this looks like the line for fstab correct?

i understand the first few portions of the line
/dev/sdax
/home/mountpoint
ntfs

which in my case is:
/dev/sda9
/home/manu/Download
ntfs - for filesystem type

but i don't get the 0 and 2 part? and what they apply to... are 0 and 2 standard? or it depends on the configurations of my drive?

fdisk -l reports this:

Code:

sudo fdisk -l
[sudo] password for manu:

Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00024aa9

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1        5099    40957686    7  HPFS/NTFS
/dev/sda2            5100      77824  584163562+  f  W95 Ext'd (LBA)
/dev/sda5            5100      17847  102398278+  7  HPFS/NTFS
/dev/sda6          17848      17872      200781  83  Linux
/dev/sda7          17873      33680  126977728+  8e  Linux LVM
/dev/sda8          63111      77824  118190173+  7  HPFS/NTFS
/dev/sda9          33681      63110  236396443+  7  HPFS/NTFS

Partition table entries are not in disk order

Quote:

Originally Posted by jamescondron (Post 3560998)
To ensure you can mount ntfs, you want to:
Code:

grep ntfs /proc/filesystems

what do you mean by this? is it to do with automatically mounting ntfs using fstab? at the moment i can mount it by just clicking on the drive... i have a few other ntfs partitions (obviously from above fdisk -l report)

jamescondron 06-02-2009 09:20 PM

Have you even tried to add this to fstab? There are generally instructions in there. From my fstab:

Code:

jc@jcmain:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>

The man page is pretty good, too.

fdisk -l was merely to suss out which the partition was.

As I thought I'd made clear, that command, should it return nothing, means you have to download the driver for ntfs. If it returns anything, you don't have to do anything.

manuleka 06-03-2009 12:45 AM

Quote:

Originally Posted by jamescondron (Post 3561051)
Have you even tried to add this to fstab? There are generally instructions in there. From my fstab:

Code:

jc@jcmain:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>  <type>  <options>      <dump>  <pass>

The man page is pretty good, too.

fdisk -l was merely to suss out which the partition was.

As I thought I'd made clear, that command, should it return nothing, means you have to download the driver for ntfs. If it returns anything, you don't have to do anything.

grep ntfs /proc/filesystems

returns nothing but i checked and i already have ntfs-3g installed

jschiwal 06-03-2009 12:51 AM

Since the directory is empty, why not reformat it using a native linux filesystem such as ext3?

manuleka 06-03-2009 01:15 AM

Quote:

Originally Posted by jschiwal (Post 3561224)
Since the directory is empty, why not reformat it using a native linux filesystem such as ext3?

because i'm running dual boot... and i want to be able to access alot of the files that will be going into this partition!

sharing with windows, i think it's easiest to keep it at ntfs...

by the way here's my fstab file after adding two lines:

Code:

# /etc/fstab
# Created by anaconda on Sat May 23 14:34:07 2009
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or vol_id(8) for more info
#
/dev/VolGroup00/LogVol00 /                      ext3    defaults        1 1
/dev/VolGroup00/LogVol02 /home                  ext3    defaults        1 2
UUID=b41c7594-4029-45ac-b477-ddea259b6289 /boot                  ext3    defaults        1 2
tmpfs                  /dev/shm                tmpfs  defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                  /sys                    sysfs  defaults        0 0
proc                    /proc                  proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                  swap          defaults        0 0
/dev/sda8        /home/manu/Extras                ntfs        defaults        1 2
/dev/sda9        /home/manu/Download                ntfs        defaults        1 2

now i aligned my new line with above lines using tab - does that matter?

billymayday 06-03-2009 01:31 AM

Tabs are fine in fstab

kirukan 06-03-2009 01:31 AM

some kernel versions support only to read (not write) even after having installed ntfs-3g, i faced this experienced on some RHEL versions

manuleka 06-03-2009 01:43 AM

Quote:

Originally Posted by kirukan (Post 3561252)
some kernel versions support only to read (not write) even after having installed ntfs-3g, i faced this experienced on some RHEL versions

have no problem with read/write into the partition :)

rikxik 06-03-2009 01:45 AM

Quote:

Originally Posted by manuleka (Post 3561236)
because i'm running dual boot... and i want to be able to access alot of the files that will be going into this partition!

sharing with windows, i think it's easiest to keep it at ntfs...

Its easiest if the partition is formatted as FAT32 - almost 100% works w/o any need for loading special modules etc. Whats stopping you from formatting this partition as FAT32 - both Linux and Windows can happily read/write? I'm using such partition for my music files - can read/write from both OSs w/o any issues.

manuleka 06-03-2009 02:31 AM

Quote:

Originally Posted by rikxik (Post 3561266)
Its easiest if the partition is formatted as FAT32 - almost 100% works w/o any need for loading special modules etc. Whats stopping you from formatting this partition as FAT32 - both Linux and Windows can happily read/write? I'm using such partition for my music files - can read/write from both OSs w/o any issues.

aah never thought about that... too late already loaded my ntfs partition with 68GB data...

ntfs works fine for me tho - so far ;)


All times are GMT -5. The time now is 03:26 AM.