LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 04: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, 05: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, 07: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, 08: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 08:08 PM.
 
Old 09-14-2005, 09:20 PM   #5
aysiu
Senior Member
 
Registered: May 2005
Distribution: Ubuntu with IceWM
Posts: 1,776

Rep: Reputation: 86
Follow these directions:

http://ubuntuguide.org/#automountfat

but just substitute su for sudo.
 
Old 09-14-2005, 09:28 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
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, 02:25 AM   #7
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 3,273

Rep: Reputation: 587Reputation: 587Reputation: 587Reputation: 587Reputation: 587Reputation: 587
I like

pico <filename>

for editing
 
  


Reply


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



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

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

All times are GMT -5. The time now is 04:12 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration