mounting root file system at boot: error w/ fstab (not fdisk)
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
mounting root file system at boot: error w/ fstab (not fdisk)
I recently installed a Oneiric based Linux distro. It booted fine until I changed my fstab. I altered my fstab so I could access my ntfs and other Linux partitions. Now when I boot in recovery mode, it hangs after 2 or 3 seconds with this message:
And then it just hangs there forever until I press the reset button on my PC. I figure that I am getting this error because I didn’t configure my fstab correctly. Here is what my fstab looks like:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda7 during installation
/dev/sda7 / reiserfs notail 0 1
# / was on UUID=ef73f69f-1518-4c85-967d-2ed64c157ef1 after installation
# swap was on /dev/sda6 during installation
UUID=7208caa3-3b2a-4134-a114-23cf92c1238d none swap sw 0 0
/dev/sda3 /home/winxp ntfs-3g defaults 0 0
/dev/sdb1 /home/ntfs2tb ntfs-3g defaults 0 0
/dev/sda2 /home/slack/ ext4 noatime 0 0
# deleted: /dev/sda5 /home/gentoo ext3 noatime 0 0
Even if ‘/dev/sda7’ is replaced with ‘UUID=ef73f69f-1518-4c85-967d-2ed64c157ef1’, I get the same error message on boot. I foolishly didn't back up my fstab before changing it so I have nothing to revert back to.
I tried adding # to the beginning of all the lines in my fstab except the line for swap and for root. My fstab therefore looks like this:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda7 during installation
#UUID=ef73f69f-1518-4c85-967d-2ed64c157ef1
/dev/sda7 / reiserfs notail 0 1
# swap was on /dev/sda6 during installation
UUID=7208caa3-3b2a-4134-a114-23cf92c1238d none swap sw 0 0
# /dev/sda3 /home/winxp ntfs-3g defaults 0 0
# /dev/sdb1 /home/ntfs2tb ntfs-3g defaults 0 0
# /dev/sda2 /home/slack/ ext4 noatime 0 0
# deleted: /dev/sda5 /home/gentoo ext3 noatime 0 0
With this fstab, it still chokes at boot at around the 3 second mark with the same error message.
Here is the output of parted -l and fdisk -l from my LiveDVD:
Code:
mint@mint ~ $ sudo parted -l
Model: ATA WDC WD3200AAKS-0 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 321MB 321MB primary ext2 boot
2 321MB 39.3GB 39.0GB primary ext4
3 39.3GB 78.3GB 39.0GB primary ntfs
4 78.3GB 320GB 242GB extended
6 78.3GB 94.3GB 16.0GB logical linux-swap(v1)
7 94.3GB 218GB 124GB logical reiserfs
5 218GB 320GB 102GB logical ntfs
Model: ATA WDC WD20EARS-00J (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 2000GB 2000GB primary ntfs
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0
has been opened read-only.
Error: /dev/sr0: unrecognised disk label
mint@mint ~ $ sudo fdisk -l
Disk /dev/sda: 320.1 GB, 320071851520 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625140335 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00087335
Device Boot Start End Blocks Id System
/dev/sda1 * 63 626534 313236 83 Linux
/dev/sda2 626535 76790699 38082082+ 83 Linux
/dev/sda3 76790700 152954864 38082082+ 7 HPFS/NTFS/exFAT
/dev/sda4 152954878 625135615 236090369 5 Extended
/dev/sda5 426477568 625135615 99329024 7 HPFS/NTFS/exFAT
/dev/sda6 152954880 184205311 15625216 82 Linux swap / Solaris
/dev/sda7 184207360 426477567 121135104 83 Linux
Partition table entries are not in disk order
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000cc3
Device Boot Start End Blocks Id System
/dev/sdb1 63 3907024064 1953512001 7 HPFS/NTFS/exFAT
mint@mint ~ $
What am I doing wrong?
I tried posting in the Linux Mint forums, but no one has replied with a solution so I thought I would try here. I hope that's not a problem.
Last edited by Drone4four; 12-09-2011 at 09:22 PM.
Good idea to comment out the unneeded lines in fstab, but the partition you are missing is:
Code:
1 32.3kB 321MB 321MB primary ext2 boot
This most likely contains your ram image and kernel, and is the only one marked bootable in your partition table. It's usually mounted on /boot. My guess is you accidentally deleted the line when you made your edits. Should look something like:
fdisk says that /dev/sda1 is set as the bootable partition. So it would be reasonable to assume that it contains my ram image and kernel....but upon closer analysis -- with that drive mounted using my LiveCD -- the contents of /dev/sda1 mounted as /boot show that all the files are dated from early 2010, when I was playing around with Gentoo. Check it:
smallpond: I will go ahead with your advice anyways and add this entry to my fstab:
Code:
/dev/sda1 /boot ext2 defaults 1 2
My new fstab therefore looks like this:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
/dev/sda1 /boot ext2 defaults 1 2
# / was on /dev/sda7 during installation
UUID=1ad64730-ac97-42a3-8420-8e8707456937 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=7208caa3-3b2a-4134-a114-23cf92c1238d none swap sw 0 0
/dev/sda3 /home/winxp ntfs-3g defaults 0 0
/dev/sdb1 /home/ntfs2tb ntfs-3g defaults 0 0
/dev/sda2 /home/slack/ ext4 noatime 0 0
# deleted: /dev/sda5 /home/gentoo ext3 noatime 0 0
I will now reboot my computer and see what happens. I will report back here with the results.
btw, the contents of /boot in my lisa partition on /dev/sda7 looks like this:
Not having a bootable partition does seem like a problem, yes. But my theory is that it’s separate from the problem I am having with my fstab. The initial error that I reported and the error I continue to experience despite my troubleshooting efforts is that the O/S can’t mount the root file system. My O/S loads premount init scripts and does a lot of other things which means, in my humble opinion, that it has nothing to do with GRUB. Since GRUB activates at boot allowing me to load Windows 7, Slackware 1337, Lisa and Lisa (recovery mode) I think the problem is with my fstab. If the bootable flag wasn’t set properly, as you suggest smallpond, then GRUB should be giving me one of it’s famous errors that can be found here: http://www.uruk.org/orig-grub/errors.html
Maybe I really don’t know know what I’m talking about. Maybe you’re right, smallpond. Question: How would I go about marking /dev/sda7 as bootable? Answer: Using fdisk. Since /dev/sda7 is the drive which has a fresh install of 64-bit Lisa, that’s the drive I want to mark bootable. My problem is I don’t know how to use fdisk. Here are the input, output and errors I get whilst using fdisk with my LiveDVD:
Code:
mint@mint ~ $ sudo fdisk -l
Disk /dev/sda: 320.1 GB, 320071851520 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625140335 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00087335
Device Boot Start End Blocks Id System
/dev/sda1 * 63 626534 313236 83 Linux
/dev/sda2 626535 76790699 38082082+ 83 Linux
/dev/sda3 76790700 152954864 38082082+ 7 HPFS/NTFS/exFAT
/dev/sda4 152954878 625135615 236090369 5 Extended
/dev/sda5 426477568 625135615 99329024 7 HPFS/NTFS/exFAT
/dev/sda6 152954880 184205311 15625216 82 Linux swap / Solaris
/dev/sda7 184207360 426477567 121135104 83 Linux
Partition table entries are not in disk order
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000cc3
Device Boot Start End Blocks Id System
/dev/sdb1 63 3907024064 1953512001 7 HPFS/NTFS/exFAT
mint@mint ~ $ sudo fdisk /dev/sda7
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): a
Partition number (1-4): 1
Warning: partition 1 has empty type
Command (m for help): a
Partition number (1-4): 2
Warning: partition 2 has empty type
Command (m for help): a
Partition number (1-4): 3
Warning: partition 3 has empty type
Command (m for help): a
Partition number (1-4): 4
Warning: partition 4 has empty type
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
mint@mint ~ $ sudo fdisk -l
Disk /dev/sda: 320.1 GB, 320071851520 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625140335 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00087335
Device Boot Start End Blocks Id System
/dev/sda1 * 63 626534 313236 83 Linux
/dev/sda2 626535 76790699 38082082+ 83 Linux
/dev/sda3 76790700 152954864 38082082+ 7 HPFS/NTFS/exFAT
/dev/sda4 152954878 625135615 236090369 5 Extended
/dev/sda5 426477568 625135615 99329024 7 HPFS/NTFS/exFAT
/dev/sda6 152954880 184205311 15625216 82 Linux swap / Solaris
/dev/sda7 184207360 426477567 121135104 83 Linux
Partition table entries are not in disk order
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000cc3
Device Boot Start End Blocks Id System
/dev/sdb1 63 3907024064 1953512001 7 HPFS/NTFS/exFAT
mint@mint ~ $
What does that “Warning: partition ‘x’ has empty type” mean? And what does error 22: Invalid argument mean? I Googled it but I can’t figure out what it means. What should I try next?
I asked in ##Linux on FreeNode and a number of idlers came forward and said that you are out to lunch, smallpond. Here is the dialogue (cropped):
Quote:
<Drone4four> question: how would i go about marking /dev/sda7 as bootable? answer: use fdisk. my problem is i don’t know how to use fdisk. Instead of using a pastebin, you can check out the ugly error message i have run into at this forum thread: http://www.linuxquestions.org/questi...-fdisk-917833/
<[R]> Drone4four: why do you think youi need to make a partition as "bootable"?
<[R]> mark*
<Drone4four> [R]: b/c fdisk says that /dev/sda1 is marked as bootable and i haven't used it in at least a year. i'm trying to get grub to load linux now on a different partition
<[R]> Drone4four: grub does not care about the bootable flag
<[R]> thats just for windows nonsense
<Drone4four> [R]: that's what i thought....but someone in my forum thread thought otherwise
<[R]> Drone4four: obviously that person is full of crap and/or just plain is a moron
<Drone4four> diegoviola, [R]: i think that your both being a little harsh...maybe he is just new to linux in comparison
<Drone4four> =D
<tsolox> be kind to animals
<[R]> if you are talking our your bum
<[R]> you shouldn't be giving advice
<br0adcast> lol
<br0adcast> thats the internet fellas, opinions are like assholes, everybody has one
<phobos_anomaly> Drone4four: If he is new, he wouldn't be trying to help with boot issues.
<phobos_anomaly> ergo since hes trying to help and giving out bad advice, hes a damn fool.
<[R]> br0adcast: giving retarded advice isn't an opinion...
<br0adcast> well sure it is
<phobos_anomaly> br0adcast: watch the language
<br0adcast> his opinion is that... yadda yadda..
<br0adcast> his advice surely is his opinion
<br0adcast> sorry phobos_anomaly, wont happen again.
<diegoviola> Drone4four: well that person then should come here to learn, in that case
<Drone4four> well could you folks take a look at my thread and offer some advice....I think what i need to do to solve my problem is to generate a default fstab from a LiveCD. how would I go about doing that?
<br0adcast> but regardless, be it an opinion or not, no excuse for giving useless info
<br0adcast> ok, then my apologies phobos ^
Your friends are correct that the Linux bootloader does not need the boot flag. However, if you have dual-boot with Windows 7, your MBR now contains the Windows bootloader. Since you don't like my information, have a look here:
"If you intend to dual-boot Windows, then you should avoid installing GRUB to the MBR. The reason for this is that Windows occasionally overwrites the MBR, for instance, when you reinstall it, and that could be quite often. When that happens, your Linux system will seem to disappear as your system starts booting directly into Windows, bypassing the boot menu altogether. To avoid this, install GRUB to the boot sector of the active partition instead."
The active partition is the one marked with the boot flag. You can use cfdisk "b" command to set this.
Last edited by smallpond; 12-10-2011 at 02:45 PM.
Reason: Add cfdisk info
Have you checked that the UUID's correspond to the devices? Some installers re-format swap, for instance, and change the UUID in the process. And maybe you should check them in grub.cfg also. Also make sure you have ro in the kernel line, or linux line, since it's grub2.
After bashing my head against the wall for several days and after troubleshooting on 3 different forums and also in ##linux on FreeNode, the only solution was to reinstall Lisa. Ugh.
The experts in ##Linux hypothesized that my problem could have been ReiserFS related, so I went with ext4 upon reinstall. No problems so far.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.