How can i edit /etc/vfstab in single user mode

Hi Experts

/etc/vfstab is corrupted as while editing it i forgot to comment some of the line.

how can i edit the file in single in user mod?

also, i have some problem in CD drive , so i cant boot it from CD and do the changes.

i tried mounding the root file system as rw, however no luck its giving me error

Thanking in anticipation

you HAVE to boot from cd/dvd or network to make the needed changes. also show us the "mount" command you've used before you get the error...

Hi Duke

I tried the below command to mount the /

i tried it from CD and i am getting the below error , not sure if the issue is there with CD or with the drive

Make sure that that device is the right name for your boot disk. Type 'format' at the command line in single user mode. It should show up on the list. If it is not then mount the proper partition. Once you are in single user mode you should be able to mount it to one of two available mount points either /mnt or /a, so the proper command would be 'mount /dev/dsk/c0t0d0s0 /mnt' assuming that c0t0d0s0 is the actual location of your boot partition. Then /mnt/etc/vfstab is the file you want to edit.

Thanks achellstrom for pointing towards the write direction.

The device path was not correct.

However now once i have booted from cdrom, mounted the hard disk to /a as

and once i am trying to edit the /a/etc/vfstab

i am unable to move the cursor i am only able to hit the enter key.

do i have to set some thing to edit the file?

Thanks

enter this in your shell:

# TERM=vt100
# export TERM
# EDITOR=vi
# export EDITOR

and try again.

or read a vi manual and use the right keys to move the cursor (h, j, k and l).

Other possible TERM types are vt220 or xterm to name a few, and ctl-l will refresh the screen before and after an edit to ensure you are on the right line. Sometimes, you will think you are on a certain line but because the TERM environment variable is not correct you will actually be editing a different line.

Thanks Duke,achellstrom !

I set the TERM and EDITOR as per your instruction, however once i am opening the vfstab with vi i am getting the below error and unable to edit the entry in vfstab

:confused:

Then you fumbled with these commands:

# TERM=vt100
# export TERM

vi reads the TERM variable from the environment to get the terminal type. Your TERM is not set.

Thanks Perderabo !

Its working okay now.

to check your settings do a:

# set | grep -i term
# env | grep -i term

both commands should return "TERM=vt100" if you've done the correct settings!

EDIT: was ONE minute to late :wink: