edit/write the /etc/fstab file


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat edit/write the /etc/fstab file
# 1  
Old 02-24-2010
edit/write the /etc/fstab file

Hi,
I comment out some vol group in fstab accidentally.
I also comment the swap space in /etc/fstab
But I cannot edit /remove it back by using vi /etc/fstab again in init 1 and init 6 .
The file system /etc/fstab is read -only . I cannot chmod .....
What can I do in order to recover it
Please advice ....
I paste the console screen in here .
edit/write the /etc/fstab file-fstab_errjpg
edit/write the /etc/fstab file-fstab_err1jpg
edit/write the /etc/fstab file-fstab_err2jpg
# 2  
Old 02-24-2010
Manually remount the appropriate filesystem as read-write. An example from man mount:
Code:
mount -o remount,rw /dev/foo /dir

# 3  
Old 02-24-2010
Reboot the system, and pass this as an additional kernel parameter (attention: at this point an english keyboard layout is in effect)
Code:
init=/bin/sh

When you've booted to an console, enter this:
Code:
mount / -oremount,rw
vi /etc/fstab
# after editing, just to be sure
sync

revert your changes, and reboot the system using either 'reboot' or by doing a cold reboot. 'shutdown' won't work at this point.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Create zip file from root owned fstab

I want to zip up my fstab file for backup purposes. This does not work because of permission issues. cd /etc/ zip -u fstab.zip fstab Can I use this with zip? echo xxx | sudo -S or change fstab owner to me? (3 Replies)
Discussion started by: drew77
3 Replies

2. Shell Programming and Scripting

How to replace value in fstab file?

Hi, I am looking to replace value (fifth and sixth ) column to "0 0" in /etc/fstab file by scripting. can any one please help me. /dev/VolGroup00/tmp /tmp ext3 defaults 1 1 (2 Replies)
Discussion started by: yash_message
2 Replies

3. Red Hat

Effects of /etc/fstab file!

Hi Folks! I accidentally overwrote in /etc/fstab file. Can you guys please tell me, what impact it would have created, when I restarted the machine(RHEL6). I executed this command : # blkid /dev/vda5 > /etc/fstab (17 Replies)
Discussion started by: nixhead
17 Replies

4. SCO

How to write/edit text in russian on SCO

Hello. I'm new to unix, and I want to write/edit text files in russian on SCO 5.0.7. Is it possible and how to do this. I tried to add russian support in KDE using kikbd, but unsuccessful. (1 Reply)
Discussion started by: OpG_
1 Replies

5. UNIX for Dummies Questions & Answers

fstab

hi , i'm creating a shell script using fstab for my project of last year, i wonder you can help me to know what is the command allow me to get the list of unmounted partitions. thanks (4 Replies)
Discussion started by: Linux001
4 Replies

6. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

7. Shell Programming and Scripting

Script to Edit the file content and create new file

I have a requirement, which is as follows *. Folder contains list of xmls. Script has to create new xml files by copying the existing one and renaming it by appending "_pre.xml" at the end. *. Each file has multiple <Name>fileName</Name> entry. The script has to find the first occurance of... (1 Reply)
Discussion started by: sudesh.ach
1 Replies

8. Linux

Parameter to edit in /etc/fstab in RH 8.0

Hi All, In RH 8.0, I am not able to mount USB pendrive. I know one method where in /etc/fstab is to be edited, so that it points to a directory /mnt/usb. After that it mount automatically. Unfortunately, i have forgotten the parameter to add in /etc/fstab-can anyone help me please? Thanks... (1 Reply)
Discussion started by: scriptlearner
1 Replies

9. Linux

How to edit /etc/fstab when root was mounted as read only

can somebody help me out in editing the /etc/fstab. I am on RHEL5 (Tikanga). **The problem is that i have given a wrong LABEL in /etc/fstab for root volume and so after reboot, it is unable to resolve the wrong LABEL; so, i have to edit the /etc/fstab :-( -ilan (3 Replies)
Discussion started by: ilan
3 Replies

10. Linux

/etc/fstab

I've created a new drive and i've added it to my fstab file but on startup it will not mount. here is how i put it into my fstab file, is that right? /dev/hdb2 /disk2a ext3 defaults 1 2 (6 Replies)
Discussion started by: byblyk
6 Replies
Login or Register to Ask a Question