LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-14-2005, 03:58 PM   #1
Mad Malc
Member
 
Registered: Jun 2004
Location: West Midlands UK
Distribution: Mint 2.1 with Kubuntu Desktop
Posts: 59

Rep: Reputation: 15
editing /etc/fstab


Hi all

Here is a beginners question, I've loaded Debian, and the /etc/fstab only contains the linux partitions. It works and looks great.

I have a FAT32 partition that I'd like to add to the fstab file. I can cat the fstab file and see it whilst logged into a root terminal.

The question is what commands do I use to open the file up for editing, add the requisite line and then close the edit and save the file.

Guess this is such a simple question but having searched all the other threads they start with
"I've added a line to fstab and now.."

Where as I haven't even got as far as adding a line yet.

Thanking you all for your replies.

Mad Malc


 
Old 09-14-2005, 04:06 PM   #2
fatrat
LQ Newbie
 
Registered: Oct 2003
Location: Richmond,MO
Distribution: Slackware 10.2
Posts: 4

Rep: Reputation: 0
fstab

I am not sure what editor you have but here is an example.......
"nano -w /etc/fstab" ...........no quotes.
 
Old 09-14-2005, 06:12 PM   #3
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
Try searching for "edit fstab" -- I'm sure there'll be some responses.

You can use any command-line editor (nano, pico, vi, vim, mcedit, the list goes on and on), and though each is completely different, they all fulfill the same function
 
Old 09-14-2005, 07:05 PM   #4
SirAeryn
LQ Newbie
 
Registered: Sep 2005
Location: Port Hedland, Western Australia
Distribution: Fedora Core 4
Posts: 18

Rep: Reputation: 0
if you do
# mount -a /dev/hda1 /mnt/Windoze -t vfat -o rw,umask=0,users,owner,fscontext=system_u:object_r:mnt_t

then it should add it to the fstab without you having to edit it manually.
You'll need to replace the hda1 above with the correct partition name... #fdisk -l to see a list. You can mount it anywhere as long as the directory already exists. I mount mine in /media/WinXP (I run FC4) so that it shows up in the file browser under Computer:///
The other options may not be entirely necessary depending on your purpose. If you intend to share the drive over a network then you need the fscontext part, and possibly the users,owner.

If you're only using it locally, then -o rw,umask=0 should be enough.

Last edited by SirAeryn; 09-14-2005 at 07:08 PM.
 
Old 09-14-2005, 08:20 PM   #5
aysiu
Senior Member
 
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,775

Rep: Reputation: 86
Follow these directions:

http://ubuntuguide.org/#automountfat

but just substitute su for sudo.
 
Old 09-14-2005, 08:28 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
I think you'll find the mount cmd adds to /etc/mtab ie a list of what's currently mounted... To survive a system reboot, it'll have to be added to /etc/fstab via eg vi/vim.
 
Old 09-19-2005, 01:25 AM   #7
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I like

pico <filename>

for editing
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing fstab GingerMegs Linux - Software 1 06-04-2005 04:24 PM
Editing etc/fstab- yet again:-) hitest Slackware 7 04-21-2005 12:50 PM
Editing fstab jodef Yoper 4 11-27-2004 09:06 AM
Who is editing my fstab???!!! laszlo Linux - Newbie 5 06-30-2004 05:37 AM
Fstab editing Ando Linux - General 4 06-29-2003 05:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration