LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
LinkBack Search this Thread
Old 10-06-2009, 06:22 PM   #1
mejohnsn
Member
 
Registered: Sep 2009
Posts: 172

Rep: Reputation: Disabled
F11: proper format for fstab line duplicating desired mount command


What I mean is: I have got into the habit of going superuser and issuing the following command: "mount /dev/sda1 /media/WinCdrive" everytime I boot Linux on my dual boot machine.

If it responds with an error message about the Windows partition hibernating, I reissue it as, ""mount -r /dev/sda1 /media/WinCdrive", so that I at least get read-only access to my Windows partition.

But I don't want to have to do this everytime. I have, after all, finally done it enough times to memorize the proper order of arguments for 'mount'

I have done enough reading of man pages on 'mount' and 'fstab' to realize that fstab is the place to make this standard, but I have not been able to figure out the proper format for the line.

So this is my question: assuming for now that read-only access is enough for the default, what is the right format to mount /dev/sda1 as 'WinCdrive' (assuming WinCdrive already created) in /etc/fstab?

And just for fun, I would also like to know how to get this to show up in Nautilus, preferably in place of that horribly long name 'SQ004109P02' that always shows up under 'Places'.
 
Old 10-06-2009, 09:15 PM   #2
John VV
Guru
 
Registered: Aug 2005
Posts: 12,081

Rep: Reputation: 1575Reputation: 1575Reputation: 1575Reputation: 1575Reputation: 1575Reputation: 1575Reputation: 1575Reputation: 1575Reputation: 1575Reputation: 1575Reputation: 1575
something like this
Code:
/dev/sda1               /mnt/Windows   ntfs-3g   defaults,umask=000     0 0
--- or this ---
/dev/sda1               /mnt/Windows   ntfs-3g   defaults,umask=220     0 0
-- or --
/dev/sda1               /mnt/Windows   ntfs-3g   defaults    0 0
dev/sda1 is my MS drive
this IS assuming you have ntfs-3g installed and NOT the very very old ,read only kmod-ntfs
 
Old 10-07-2009, 02:24 AM   #3
mejohnsn
Member
 
Registered: Sep 2009
Posts: 172

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
something like this
Code:
/dev/sda1               /mnt/Windows   ntfs-3g   defaults,umask=000     0 0
--- or this ---
/dev/sda1               /mnt/Windows   ntfs-3g   defaults,umask=220     0 0
-- or --
/dev/sda1               /mnt/Windows   ntfs-3g   defaults    0 0
dev/sda1 is my MS drive
this IS assuming you have ntfs-3g installed and NOT the very very old ,read only kmod-ntfs
Since you say "something like" and use the non-Fedora assumption of '/mnt' for mounts, I made a slight change to the last line you suggested and did:

/dev/sda1 /media/WinCdrive ntfs-3g defaults 0 0

This fails silently. I can't even find a message in /var/log/messages referring to it. The last reference to 'ntfs-3g' in /var/log/messages was from the previous day, nothing was written to messages when I rebooted after editing fstab.

So what should I try next?
 
Old 10-07-2009, 05:43 AM   #4
decrepit
Member
 
Registered: May 2006
Distribution: Ubuntu10.04, < fedora12
Posts: 347

Rep: Reputation: 34
Maybe it's not mounting at boot up.
Try --
mount /media/WinCdrive

You may need to do that as root.
This will check the fstab line, if you don't specify a device, only the destination, "mount" checks fstab for the info.
With any luck you should get some sort of error message if it doesn't mount.
 
1 members found this post helpful.
Old 10-07-2009, 12:00 PM   #5
mejohnsn
Member
 
Registered: Sep 2009
Posts: 172

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by decrepit View Post
Maybe it's not mounting at boot up.
Try --
mount /media/WinCdrive

You may need to do that as root.
This will check the fstab line, if you don't specify a device, only the destination, "mount" checks fstab for the info.
With any luck you should get some sort of error message if it doesn't mount.
I did a little more reading in the man page for 'fstab' and for 'mount'. On the basis of that reading, I decided to try changing the line in fstab to:

/dev/sda1/ /media/WinCdrive ntfs-3g defaults,ro 0 0

This does get mounted at boot time, so now there is no need for me to do "mount /media/WinCdrive" by hand.

The only drawback is that this always mounts read only, whether WinCdrive is hibernated or not. But I think I can live with this.
 
Old 10-08-2009, 05:37 AM   #6
decrepit
Member
 
Registered: May 2006
Distribution: Ubuntu10.04, < fedora12
Posts: 347

Rep: Reputation: 34
Probably read only because it's at root level, you can change that by adding the "umask=000" into the line, or "users,rw" I think the ro you have means read only, whereas rw means read write.

I'm not sure about adding the extra "/" after /dev/sda1, did you have the line as you have shown? Normally there is a "tabbed" gap between the partition and where it's mounted.

Last edited by decrepit; 10-08-2009 at 05:46 AM.
 
Old 10-09-2009, 12:50 AM   #7
mejohnsn
Member
 
Registered: Sep 2009
Posts: 172

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by decrepit View Post
Probably read only because it's at root level, you can change that by adding the "umask=000" into the line, or "users,rw" I think the ro you have means read only, whereas rw means read write.

I'm not sure about adding the extra "/" after /dev/sda1, did you have the line as you have shown? Normally there is a "tabbed" gap between the partition and where it's mounted.
In /etc/fstab, it is as shown, '/dev/sda1/'. What 'gap' are you referring to?

I would not want to change 'ro' to 'rw' unconditionally, since that fails if the WinXP partition is hibernated -- which it often is.

Last edited by mejohnsn; 10-10-2009 at 02:53 PM. Reason: spelling fix
 
Old 10-10-2009, 07:41 AM   #8
decrepit
Member
 
Registered: May 2006
Distribution: Ubuntu10.04, < fedora12
Posts: 347

Rep: Reputation: 34
You've written this.

"/dev/sda1 /media/WinCdrive ntfs-3g defaults 0 0"

In fstab it should look like this

"/dev/sda1 [space] /media/WinCdrive [space] ntfs-3g [space] defaults [space] 0 0"

But I've just discovered that spaces don't show on these pages, so sorry, my comment is probably irrelevant

Last edited by decrepit; 10-10-2009 at 07:43 AM.
 
  


Reply

Tags
filesystem, fstab, hibernate, mount, nautilus


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Execute desired line from the file say_hi_ravi Programming 2 04-09-2008 07:37 AM
PDF to Command line format Tux-O-Matic General 6 10-04-2006 07:05 AM
[mtent] line 7 in /etc/fstab is bad (CD Drives wont Mount) shof515 Linux - Hardware 1 11-24-2005 08:57 AM
print files in PDF or html format from the linux command line IBKnobel Linux - Software 3 07-12-2004 09:29 PM
WARNING: Bad format on line 10 of /etc/fstab thetwin Linux - Newbie 22 03-05-2003 12:55 AM


All times are GMT -5. The time now is 01:35 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration