PDA

View Full Version : [SOLVED] (12.04) partition not mounting at boot



mzimmers
June 9th, 2012, 02:51 PM
I have a second drive on my system, which has a partition for Windows, and one for Ubuntu. When I boot into Ubuntu, I get an error saying that the system was unable to mount this device. I choose "s" for skip, the boot completes, and then I'm able to manually mount via gparted.

I probably have to give you more information to answer this, but...what might be going on, and what's the recommended disk utility for fixing such an issue?

Thanks.

drs305
June 9th, 2012, 02:58 PM
Once you boot, open /etc/fstab as root. There is most likely a line trying to mount a partition which isn't working. You can disable that line by placing a # symbol at the start of the line, or you can edit the line to make it correct.

It could be an incorrect UUID (check UUIDs with 'sudo blkid'), a non-existent mount point (make it), etc.

To edit fstab:

gksu gedit /etc/fstab

If you can figure it out, post the contents of fstab and the output of "sudo blkid".

mzimmers
June 9th, 2012, 03:29 PM
Hi, drs -

Contents of /etc/fstab:


# /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/sda6 during installation
UUID=2b3a266c-5751-4de4-81c7-72eeb3a9cc15 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda7 during installation
UUID=c8da4520-a43b-404d-a4a7-d802391a0e62 none swap sw 0 0
/dev/sdb2 /media/sdb2 ntfs nls=iso8859-1,ro,users,umask=644,gid=mzimmers,user,owner,uid=m zimmers 0 0

Output of sudo blkid:

/dev/sda1: LABEL="System Reserved" UUID="AA70CBF170CBC275" TYPE="ntfs"
/dev/sda2: UUID="26A2E4FCA2E4D17B" TYPE="ntfs"
/dev/sda5: UUID="530c8b1a-5050-4c16-a562-219083d17a00" TYPE="swap"
/dev/sda6: UUID="2b3a266c-5751-4de4-81c7-72eeb3a9cc15" TYPE="ext4"
/dev/sdb1: UUID="4CFDA2557B6F1A46" TYPE="ntfs"
/dev/sdb2: LABEL="Ubuntu backups" UUID="a72e6a43-904e-43c3-8edd-2632481d7735" TYPE="ext2"
/dev/zram0: UUID="dd3aaa63-3232-48b8-93ce-967fd543eaf7" TYPE="swap"


Thanks for the help.

drs305
June 9th, 2012, 03:47 PM
/dev/sdb2 /media/sdb2 ntfs nls=iso8859-1,ro,users,umask=644,gid=mzimmers,user,owner,uid=m zimmers 0 0
The above entry in your fstab points to sdb2 and tries to mount it as ntfs.

According to the system, sdb2 is ext2:

/dev/sdb2: LABEL="Ubuntu backups" UUID="a72e6a43-904e-43c3-8edd-2632481d7735" TYPE="ext2"

I would make a new mountpoint for it, make yourself the owner of the mountpoint so you 'own' the files once fstab mounts it, and make the following entry in fstab. Of course you can change the mountpoint location/name to anything you want. And I'm assuming your username is mzimmers


sudo mkdir /mnt/ubuntu_backups
sudo chown -R mzimmers: /mnt/ubuntu_backups

Change the sdb2 fstab entry to:

UUID=a72e6a43-904e-43c3-8edd-2632481d7735 /mnt/ubuntu_backups ext2 defaults,users,auto 0 2

Once you have made the change and saved the file, test to see if it mounts.


sudo umount /dev/sdb2 # Note it may not be mounted and the command will say so
sudo mount -a # Attempts to mount all fstab entries. It will complain if one or more won't work

mzimmers
June 9th, 2012, 09:07 PM
OK, we have at least partial success here. I no longer get the error upon starting, but the partition doesn't seem to be mounted.

New contents of /etc/fstab:


# /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/sda6 during installation
UUID=2b3a266c-5751-4de4-81c7-72eeb3a9cc15 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda7 during installation
UUID=c8da4520-a43b-404d-a4a7-d802391a0e62 none swap sw 0 0
UUID=a72e6a43-904e-43c3-8edd-2632481d7735 /mnt/ubuntu_backups ext2 defaults,users,auto 0 2


The mount command doesn't return an error, by the way, but the drive doesn't show up in my file system browser, so I must have done something incorrectly.

drs305
June 9th, 2012, 09:10 PM
Does the "mount" command display the partition as mounted?

What happens if you run this command, which should open the partition in a file browser:

nautilus /mnt/ubuntu_backups &

If there is a permission issue, try the same preceeded by "gksu".

Morbius1
June 9th, 2012, 09:27 PM
Excuse the interruption but there's something odd here. It shouldn't have affected the mounting of /mnt/ubuntu_backup but this line in fstab references a partition that doesn't exist:

UUID=c8da4520-a43b-404d-a4a7-d802391a0e62 none swap sw 0 0Swap isn't mounted in the conventional sense but I'm wondering if it's stopping the execution of the next line in fstab.

Since there are so many changes being made to the partitions you might want to re-verify the UUID numbers by running blkid another way:

sudo blkid -c /dev/null

mzimmers
June 9th, 2012, 11:58 PM
drs: the nautilus command works fine -- opens a window where I can see what I'd expect to see. BUT: inside /media/sdb2 there's nothing (that I can see from the GUI).

Morbius: the results of "sudo blkid -c /dev/null are:


mzimmers@mzimmers-desktop:~$ sudo blkid -c /dev/null
[sudo] password for mzimmers:
/dev/sda1: LABEL="System Reserved" UUID="AA70CBF170CBC275" TYPE="ntfs"
/dev/sda2: UUID="26A2E4FCA2E4D17B" TYPE="ntfs"
/dev/sda5: UUID="530c8b1a-5050-4c16-a562-219083d17a00" TYPE="swap"
/dev/sda6: UUID="2b3a266c-5751-4de4-81c7-72eeb3a9cc15" TYPE="ext4"
/dev/sdb1: UUID="4CFDA2557B6F1A46" TYPE="ntfs"
/dev/sdb2: LABEL="Ubuntu backups" UUID="a72e6a43-904e-43c3-8edd-2632481d7735" TYPE="ext2"
/dev/zram0: UUID="b6b77824-eec0-4524-9ab9-0a17e5be0b0d" TYPE="swap"


I may have messed up something when I was fiddling with swap spaces awhile back.

Thanks...

drs305
June 10th, 2012, 12:03 AM
drs: the nautilus command works fine -- opens a window where I can see what I'd expect to see. BUT: inside /media/sdb2 there's nothing (that I can see from the GUI).

Morbius: the results of "sudo blkid -c /dev/null are:


mzimmers@mzimmers-desktop:~$ sudo blkid -c /dev/null
[sudo] password for mzimmers:
/dev/sda1: LABEL="System Reserved" UUID="AA70CBF170CBC275" TYPE="ntfs"
/dev/sda2: UUID="26A2E4FCA2E4D17B" TYPE="ntfs"
/dev/sda5: UUID="530c8b1a-5050-4c16-a562-219083d17a00" TYPE="swap"
/dev/sda6: UUID="2b3a266c-5751-4de4-81c7-72eeb3a9cc15" TYPE="ext4"
/dev/sdb1: UUID="4CFDA2557B6F1A46" TYPE="ntfs"
/dev/sdb2: LABEL="Ubuntu backups" UUID="a72e6a43-904e-43c3-8edd-2632481d7735" TYPE="ext2"
/dev/zram0: UUID="b6b77824-eec0-4524-9ab9-0a17e5be0b0d" TYPE="swap"


I may have messed up something when I was fiddling with swap spaces awhile back.

Thanks...

First, youir swap entry in fstab should have the UUID in red, as the one in fstab is incorrect. (Hat tip Moribus1).

There is nothing inside /media/sdb2 because the partition is no longer mounted there.

If the /mnt/ubuntu_backups folder doesn't show in your file browser's side pane, you can probably drag it into the Shortcuts section of the side pane you you can click on 'ubuntu_backups' to see the contents of the sdb2 partition.

drs305
June 10th, 2012, 12:04 AM
drs: the nautilus command works fine -- opens a window where I can see what I'd expect to see. BUT: inside /media/sdb2 there's nothing (that I can see from the GUI).

Morbius: the results of "sudo blkid -c /dev/null are:


mzimmers@mzimmers-desktop:~$ sudo blkid -c /dev/null
[sudo] password for mzimmers:
/dev/sda1: LABEL="System Reserved" UUID="AA70CBF170CBC275" TYPE="ntfs"
/dev/sda2: UUID="26A2E4FCA2E4D17B" TYPE="ntfs"
/dev/sda5: UUID="530c8b1a-5050-4c16-a562-219083d17a00" TYPE="swap"
/dev/sda6: UUID="2b3a266c-5751-4de4-81c7-72eeb3a9cc15" TYPE="ext4"
/dev/sdb1: UUID="4CFDA2557B6F1A46" TYPE="ntfs"
/dev/sdb2: LABEL="Ubuntu backups" UUID="a72e6a43-904e-43c3-8edd-2632481d7735" TYPE="ext2"
/dev/zram0: UUID="b6b77824-eec0-4524-9ab9-0a17e5be0b0d" TYPE="swap"


I may have messed up something when I was fiddling with swap spaces awhile back.

Thanks...

First, youir swap entry in fstab should have the UUID in red, as the one in fstab is incorrect. (Hat tip Moribus1).

There is nothing inside /media/sdb2 because the partition is no longer mounted there.

If the /mnt/ubuntu_backups folder doesn't show in your file browser's side pane, you can probably drag it into the Shortcuts section of the side pane you you can click on 'ubuntu_backups' to see the contents of the sdb2 partition.

If you want the partition to show in the upper part of the side pane you will probably have to create a new mountpoint in /media and make that change in fstab as well. I know the Ubuntus of long ago would automatically place /media folders in the upper pane but not those in /mnt. Don't know if that is still true today or not.

mzimmers
June 10th, 2012, 12:17 AM
OK, I made that change to the /etc/fstab file, and the system now boots without incident (yay!).

So, should I remove the sdb2 entry from /media? If so, is there a special way of doing it, or can I just drag the file to the trash?

On a related question, I do see a couple of partitions for my Windows boot in my sidebar; is there a way to remove these, or is this just the way it's going to be?

Thanks for all the help, guys.

drs305
June 10th, 2012, 12:27 AM
OK, I made that change to the /etc/fstab file, and the system now boots without incident (yay!).

So, should I remove the sdb2 entry from /media? If so, is there a special way of doing it, or can I just drag the file to the trash?
You can remove it - just make sure it's empty before actually deleting the /media/sdb2 folder. The side panes are just shortcuts, so you may be able to remove the sdb2 folder by right clicking and deleting. If you can't, open nautilus as root, make sure there is nothing in the folder, then move up one level and remove/delete the 'sdb2' folder.


mount # Check that sdb2 is not mounted on /media/sdb2 (or any other partition, for that matter)
gksu nautilus /media/sdb2



On a related question, I do see a couple of partitions for my Windows boot in my sidebar; is there a way to remove these, or is this just the way it's going to be?

I don't use Windows so I'll defer to someone who does since I don't know how they are displayed.

mzimmers
June 10th, 2012, 12:36 AM
Thanks, drs. I just deleted it using Terminal (it was indeed empty).

Don't sweat the Windows partitions; that was just an aside. I consider this solved.

Is there a short tutorial somewhere on /dev, /media and /mnt? I'm not sure I really understand the nuances of these directories.

Thanks again for all the help.

drs305
June 10th, 2012, 12:49 AM
Is there a short tutorial somewhere on /dev, /media and /mnt? I'm not sure I really understand the nuances of these directories.


I don't have any great links. Generally the distinctions between /media and /mnt have diminished over time. Years ago there were users who would get upset using /mnt for a removable drive or /media for a permanent device.

Here is one link regarding the way the Linux file structure is tailored.
http://swift.siphos.be/linux_sea/ch05.html

I'll throw in two more minor observations. Your partition is formatted ext2. You can use it as ext3 without any changes other than the fstab entry. ext4 is now the default for Ubuntu and is very stable for most users (not that you would notice the difference). If you ever make a new partition, I'd recommend formattting it to ext4 rather than ext2.

Also, your label for sdb2 is "ubuntu backups". Labels are great and can really make things simpler. Having spaces in the name - not so much. If you ever want to change the name, you can do it with this command. Just change fstab to match if you change it.

sudo tune2fs -L somenamewithoutspaces /dev/sdb2

mzimmers
June 10th, 2012, 12:58 AM
Thanks for the observations. I'm curious, though...the label "Ubuntu backups" doesn't appear anywhere in /etc/fstab. What am I supposed to change to "match" whatever I do with tune2fs?

I'll remember your comment about ext2/3/4, too.

drs305
June 10th, 2012, 01:05 AM
Thanks for the observations. I'm curious, though...the label "Ubuntu backups" doesn't appear anywhere in /etc/fstab. What am I supposed to change to "match" whatever I do with tune2fs?

I'll remember your comment about ext2/3/4, too.

Sorry for the confusion. I use labels in fstab but forgot you didn't. UUIDs are better than "/dev/sdXY", but for me labels are even better since they mean something. An fstab entry for a label would replace UUID with the label name, such as for "ubuntu_backups"

LABEL=ubuntu_backups /mnt/<mountpoint> ext3 ........

You can use a label with spaces by "escaping it". For "ubuntu backups":

LABEL=ubuntu\040backups /mnt/<mountpoint> ext3 ........

mzimmers
June 10th, 2012, 01:39 AM
Done. I ran tune2fs and changed /etc/fstab, and restarted. It appears to have worked. (I used a label with no spaces, too.) Thanks again!