Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

It seems that I have added incorrect record to /etc/fstab:

//servername/share    /mnt/share    cifs     defaults,username=myuser     0 0

When I did mount -a, it asked user password to mount network share. It seems that it cannot proceed without password on boot, so it is just hung.

How can I fix fstab to prevent boot failure?

share|improve this question
add comment

2 Answers

How about removing the entry, creating a snapshot and then trying to change your /etc/fstab so you have a working snapshot you can roll back to?

According to the manpage mount.cifs you can also specify a password via password=arg. Also, according to that manpage there is no argument username=arg but instead user=arg. But it might be different on your system, better check your manpage for the correct argument names.

share|improve this answer
    
man for the win. –  Tim Jul 26 '12 at 13:22
    
I was about to create snapshot, but while I was experimenting with fstab, vm instance went off for some reason. Apparently, I wouldn't ask the question if I could fix it myself. –  altern Jul 26 '12 at 13:31
2  
Your problem description is a little bit unclear. Can't you boot in single user / recovery mode? It should only try to mount the root fs and leave the fstab alone. –  scai Jul 26 '12 at 13:54
add comment
up vote 2 down vote accepted

It seems that I've found a solution:

  • at the grub prompt, hit a to append options
  • add init=/bin/bash to the kernel command line
  • mount -o remount,rw /
  • vim /etc/fstab
  • reboot
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.