fstab me in the heart (can't boot)

Discussions about using Linux guests in VirtualBox.
Post Reply
robbmaclean
Posts: 4
Joined: 25. Jun 2010, 01:52
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: ubuntu server, windows server 2003

fstab me in the heart (can't boot)

Post by robbmaclean »

Hi all, I read the extremely helpful announcement "HOWTO: Use Shared Folders" after attempting to add a line to my guest ubuntu 10.4 server's /etc/fstab file.

Now my guest won't boot. I didn't see that coming! When I attempt to boot into recovery mode (by holding down shift to get into the grub menu) I am still thwarted. I think I just need to get that new line outta the fstab file to get back on track.

Has anyone had this problem before? Thanks for your time!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: fstab me in the heart (can't boot)

Post by Perryg »

You are not alone others have done the same thing. You must boot to recovery mode (hold the left shift key down until you see the grub menu) and edit the /etc/fstab using vi and at the very least comment that line out with a # (:wq) and reboot.
Then once you get it working again you need to place the mount in the /etc/rc.local file.

Steps:
hold left shift to grub.
select recovery
arrow down and select the root mode
type vi /etc/fstab
use i for insert arrow down to the line and add #
press the esc key
type :wq <enter>
Type reboot and cross your fingers & toes.
robbmaclean
Posts: 4
Joined: 25. Jun 2010, 01:52
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: ubuntu server, windows server 2003

Re: fstab me in the heart (can't boot)

Post by robbmaclean »

Hi Perryg, Thanks a lot for your advice! I have been trying to get to that point, but I am still getting the error when I choose recovery mode from the grub menu.

The error message that makes my boot stop:
---
/sbin/mount.vboxsf: mounting failed with the error: No such device
mountall: mound /home/robb/sites [459] terminated with status 1
mountall: Filesystem could not be mounted: /home/robb/sites
mountall: fsck /boot [240] terminated with status 1
---

when I hold shift to get into the grub menu, and choose "e" to edit (err, I mean, "look", don't want to make matters worse) the grub "recovery mode" option this is what I see:
---
recordfail
insmod ext2
set root='(hd0,1)'
search --no-floppy --fs-uuid --set cdd38ac6-26c1-4d71-82d8-4500e02ed\
eda
echo 'Loading Linux 2.6.32-21-generic ...'
linux /vmlinuz-2.6.32-21-generic root=/dev/mapper/dev-root ro single\

echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.32-21-generic
---

from what I have read it seems like this should boot me into single user mode, and maybe it is, but fstab is still being read and is causing the boot to fail. Boo![t]

Any thoughts?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: fstab me in the heart (can't boot)

Post by Perryg »

Yes I do. When you get to the grub menu you should arrow down to recovery and press enter. Pressing e will allow you to edit the boot parameter but that is not needed. Are you saying that you do select the recovery mode and press enter and it still fails?
The only other way is to boot to the install CD/DVD and edit the fstab from there. Not as easy but doable, or it used to be. Have not tried that with the newer Ubuntu LiveCD's but it would be strange if they changed that.
robbmaclean
Posts: 4
Joined: 25. Jun 2010, 01:52
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: ubuntu server, windows server 2003

Re: fstab me in the heart (can't boot)

Post by robbmaclean »

Unfortunately for me booting recovery mode from my grub menu still gets thwarted by the fstab boot error. I've been trying to use a live cd to mount the filesystem but I've been stumped on how to mount the extended partition? I can mount /dev/sda1 no problem, but I think that's just /boot. Here's what I'm working with... (I sure do appreciate your taking the time to help me out!)

Code: Select all

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000954e3

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          32      248832   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              32        1045     8136705    5  Extended
/dev/sda5              32        1045     8136704   8e  Linux LVM

ubuntu@ubuntu:~$ sudo mkdir /mnt/pleasework
ubuntu@ubuntu:~$ sudo mount -t ext4 /dev/sda1 /mnt/pleasework
ubuntu@ubuntu:~$ ls /mnt/pleasework/
abi-2.6.32-21-generic         memtest86+.bin
config-2.6.32-21-generic      System.map-2.6.32-21-generic
grub                          vmcoreinfo-2.6.32-21-generic
initrd.img-2.6.32-21-generic  vmlinuz-2.6.32-21-generic
lost+found

* I'd also like to point out to any other readers that my problems here have nothing to do with VirtualBox! I just made a mistake when trying to auto mount the vbox share at boot time. Don't try to do it in the /etc/fstab file!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: fstab me in the heart (can't boot)

Post by Perryg »

It has been a while but you should see a rescue option when you boot the LiveCD.
Once booted this should put the root file system at /target directory

You should search the Ubuntu help to find the exact steps as I do not want to send you down the wrong road. I can do this myself but telling someone and leaving out a step is never a good thing.
robbmaclean
Posts: 4
Joined: 25. Jun 2010, 01:52
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: ubuntu server, windows server 2003

Re: fstab me in the heart (can't boot) [SOLVED]

Post by robbmaclean »

Thank goodness. Here is a wonderful post that explains how to mount a Logical Volume.
http://linuxwave.blogspot.com/2007/11/m ... ivecd.html

Apparently they are not active be default and it is not as simple as guessing the right mount command to do the job. Here is what I did: (After booting ubuntu 10.4 desktop live cd and opening a terminal)

Get the lvm2 package

Code: Select all

# apt-get install lvm2
Reveals the volume groups available (I just had one, mine had the label "dev")

Code: Select all

# pvscan
Activates all volume groups

Code: Select all

# vgchange -a y
Reveals all active volume groups and makes you feel sane again (for me it was "root" and "swap" - hell yeah!)

Code: Select all

# lvscan
Mount the partition you want, for me it was the following but it will depend on the name of your volume group and mount location

Code: Select all

# mount /dev/dev/root /mnt/pleasework
Fix your fstab file

Code: Select all

vi /dev/dev/root/etc/fstab
Reboot and pat yourself on the back.
(Major dudes, try not to laugh too much that I'm patting myself on the back for figuring out how to do that, Extended Partitions and Logical Volume Groups are pretty rough on us newbies!)

Perryg, thanks for workin' with me on that one!
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: fstab me in the heart (can't boot)

Post by Sasquatch »

Wow! I never imagined that adding the GA to fstab could cause so much problems. I do know now that when you edit your fstab, it MUST end with a newline. This I became aware of after I edited the file myself on my dual boot laptop to include the NTFS partitions and I wanted to mount them. I got a message stating that fstab didn't end with a newline. It did mount properly, but it might complain otherwise.

Further, there isn't a reason why boot would stall by a failed mount of the SF. It's my first time hearing about it.
And yeah, LVM can be tricky for new users.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply