LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-02-2007, 12:03 PM   #1
hulk321
Member
 
Registered: Jul 2007
Posts: 137

Rep: Reputation: 15
Can't edit fstab??


hi,

i can not edit my fstab. it say permission denied eventhough i have logged in as root.
what do i do? please help.
 
Old 07-02-2007, 12:41 PM   #2
bsdunix
Senior Member
 
Registered: May 2006
Distribution: BeOS, BSD, Caldera, CTOS, Debian, LFS, Mac, Mandrake, Red Hat, Slackware, Solaris, SuSE
Posts: 1,761

Rep: Reputation: 80
What is the output of:
Code:
# ls -l /etc/fstab
 
Old 07-03-2007, 12:39 PM   #3
hulk321
Member
 
Registered: Jul 2007
Posts: 137

Original Poster
Rep: Reputation: 15
Smile

hi,

the output is as follows

-rw-r--r-- 1 root root 542 Jul 3 22:03 /etc/fstab

what do i do now? i am using Fedra core 4
 
Old 07-03-2007, 01:22 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
In a terminal, do "su" to become root, and then open an editor like so:
gedit /etc/fstab

That SHOULD work
 
Old 07-03-2007, 01:34 PM   #5
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 548

Rep: Reputation: 33
Permissions show you should be able to edit the file.
If using vi, even when it says it can't write the file out if you do a
:w!
in command mode (not insert mode) it will write the file. The ! forces it.
 
Old 07-03-2007, 02:48 PM   #6
sullise
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by DotHQ
Permissions show you should be able to edit the file.
If using vi, even when it says it can't write the file out if you do a
:w!
in command mode (not insert mode) it will write the file. The ! forces it.
Might have the immutable attribute set.

Do: lsattr /etc/fstab

If it comes back with:

s---i---c--------- /etc/fstab

( the i means it's set to immutable ).

To be able to update it, do:

chattr -i /etc/fstab

To change it back once done updating do

chattr +i /etc/fstab
 
Old 07-04-2007, 12:18 PM   #7
hulk321
Member
 
Registered: Jul 2007
Posts: 137

Original Poster
Rep: Reputation: 15
Smile

Quote:
Originally Posted by pixellany
In a terminal, do "su" to become root, and then open an editor like so:
gedit /etc/fstab

That SHOULD work
thanks. it has worked and i am able to edit fstab. please find output of fstab;

Disk /dev/sda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1275 10241406 c W95 FAT32 (LBA)
/dev/sda2 1276 10010 70163887+ f W95 Ext'd (LBA)
/dev/sda5 1276 2550 10241406 b W95 FAT32
/dev/sda6 2551 5100 20482843+ b W95 FAT32
/dev/sda7 5101 7650 20482843+ b W95 FAT32
/dev/sda8 7651 10010 18956668+ 83 Linux

now i want to mount all sda5,6 and 7 drives. please correct me as it doesnt agree with this command;

mount -t vfat/dev/sda5 /mnt/c_drive

it say i am not using -t command right. please guide!

also, what should i type in fstab once i have mounted these drives?? step by step plese!
 
Old 07-04-2007, 12:21 PM   #8
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Need a space.

mount -t vfat /dev/sda5 /mnt/c_drive
 
Old 07-04-2007, 01:04 PM   #9
hulk321
Member
 
Registered: Jul 2007
Posts: 137

Original Poster
Rep: Reputation: 15
Smile

Quote:
Originally Posted by Hern_28
mount -t vfat /dev/sda5 /mnt/c_drive
thanks Hern28. it works.

what command i should put in fstab so that i dont need to mount it everytime i boot?
 
Old 07-04-2007, 01:11 PM   #10
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
/dev/sda5 /mnt/c_drive vfat auto,rw 0 0

should do it. You may like to read the following: http://www.tuxfiles.org/linuxhelp/fstab.html.
 
Old 07-04-2007, 01:15 PM   #11
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Anytime.

Nylex's should get your setup finished. Goodluck .
 
Old 07-04-2007, 01:39 PM   #12
hulk321
Member
 
Registered: Jul 2007
Posts: 137

Original Poster
Rep: Reputation: 15
Smile Thanks for your time!

[QUOTE=Nylex]/dev/sda5 /mnt/c_drive vfat auto,rw 0 0

should do it.

i have opened fstab remaining in terminal through this command;

nano /etc/fstab

i have incorporated the changes as your directed me to. then rebooted. but nothing has happened??

when i directly try to open fstab it doesnt permit me to make changes ????
 
Old 07-04-2007, 01:42 PM   #13
Hern_28
Member
 
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Try:

/dev/sda5 /mnt/c_drive vfat defaults 1 1

You will need to get into root user mode using a root terminal, su, or sudo then nano fstab to be able to edit. Be sure the drive is not mounted in the file manager or you might not see the change.

Last edited by Hern_28; 07-04-2007 at 01:44 PM.
 
  


Reply

Tags
chattr, immutable


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
can't edit /etc/fstab....please help expat Linux - Software 32 10-26-2006 01:48 PM
fstab not edit-able? lefty.crupps MEPIS 1 06-06-2005 05:36 PM
How do I edit /etc/fstab? linusownsme Linux - Software 9 03-05-2005 11:30 AM
fstab edit craigers Linux - Software 15 12-03-2004 06:02 AM
edit fstab LinuxOG Linux - Distributions 2 09-01-2003 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:22 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
Open Source Consulting | Domain Registration