LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Do I have to re-mount a windows NTFS partition every time I boot up? (https://www.linuxquestions.org/questions/linux-general-1/do-i-have-to-re-mount-a-windows-ntfs-partition-every-time-i-boot-up-705341/)

jphpe 02-17-2009 07:53 AM

Do I have to re-mount a windows NTFS partition every time I boot up?
 
I just loaded Ubuntu 8.1 as a dual-boot system with XP. To get access to my windows files from Linux I mounted a windows NTFS file partition, which worked exactly as described. However, when I restart the computer the directory is there, with a padlock icon next to it, but it is empty. Do I need to re-mount this partition every time I start my computer?

Thanks,
Jack

CJS 02-17-2009 08:46 AM

It sounds like you need to add your Windows partition to your /etc/fstab file, and then it will be automatically mounted on start up. How about doing:
Code:

gksudo gedit /etc/fstab
And then add the following lines:
Code:

# Mounting Windows partition:
/dev/sda1 /media/Windows        ntfs defaults,uid=0,gid=46,auto,rw,nouser,umask=007 0 0

So change sda1 to your Windows partition, and also make sure whichever directory you want to mount it to exists. In other words, in the above example the /media/Windows directory needs to exist so you can mount to it. You can create a directory with:
Code:

sudo mkdir /media/Windows
Anyway, let me know how that goes.

jschiwal 02-17-2009 09:40 AM

Instead of `uid=0' use 'uid=<yourusername>'. If your default group is the same, you can use the same for 'gid='.

jphpe 02-19-2009 06:47 PM

Hi, CJS and jschiwal:

Thanks for the advice. I tried using the code you suggested but the partition would not load on startup. The code I used to mount the partition, on directory "/media/windows" is:

"mount /dev/sda2 /media/windows/ -t ntfs -o nls=utf8,umask=0222"

This code works fine but I have to re-enter it each time I boot up. Are there some variations in the code you suggested that would work like the line above?

Thanks again for your help. So far I much prefer Linux to Windows, and I was hoping to use this partition access to limit the amount of time I would need to boot into XP. It won't be the end of the world if I can't get this to work, but it would be nice if I could.

alan_ri 02-19-2009 08:19 PM

Please read carefully what others have already told you.
You need to edit fstab and add a line like this;
Code:

/dev/sda2      /media/windows      ntfs-3g defaults        0      0
Problem solved.

jphpe 02-20-2009 09:43 AM

Thanks, alan ri. I tried the code you suggested and it worked beautifully.

Just to be clear, I had previously edited my /etc/fstab to add the exact code that CJS recommended, both with and without the new userid and groupid suggested by jschiwal. I don't know what all of the parameters are for in his code but the windows partition was not showing up. I provided the code I had used for the temporary partition mounting only because it worked and there are similar parameters. I'm new to Linux and trying to learn as quickly as I can, but sometimes the code is difficult to follow.

In any event, thanks again for the code you provided. I'm finding the Linux community is much more knowledgeable and helpful than I expected.

Sincerely,
Jack


All times are GMT -5. The time now is 07:20 AM.