Posts Tagged ‘partition’

If you’ve upgraded your Ubuntu system only to find you don’t have permission to do pretty much anything, as I did after upgrading to 13.10, it can be pretty annoying even for an advanced user, and downright scary for a novice. The symptoms are pretty obvious, as when you go to install updates, all you get is an error message saying “This operation cannot continue since proper authorization was not provided“. And using the Shutdown button seems to do nothing, and even using a terminal command to power off might see the shutdown process halt half-way through, forcing you to use the PC’s power button.

On top of that, even mounting removable drives (or other partitions on your internal drive) ends in being told you can’t, and even trying to play a DVD ends with “Unable to access “DVDVIDEO”. Not authorized to perform operation.

While there are ways around all of these situations for more advanced users, those less experienced with Ubuntu/Linux would find it all quite daunting, and pretty much look at their system as unusable. And one shouldn’t have to go through the bother of manually mounting drives through the terminal, or invoking the Software Updater as superuser, or any other thing we usually take for granted.

Luckily, the fix – which involves PAM (Pluggable Authentication Modules) – is actually quite simple, and should have everything back to normal in no time.

In a terminal, enter the following command to edit the PAM authentication file for the LightDM display manager:

gksu gedit /etc/pam.d/lightdm

Under the first line “#%PAM-1.0” paste the following 2 lines:

session required pam_loginuid.so
session required pam_systemd.so

Save and exit the file, then log out and back in again, and all should now be fine (you shouldn’t need to reboot).


Another method, which fixed the problem for some (but not in my case, and many others) is to run:

sudo pam-auth-update --force

This opens PAM‘s config within the terminal, at which you either check or uncheck items, or just hit Tab to go to OK, and hit Enter.


If need be, like you have GDM installed and it is interfering with LightDM, run dpkg-reconfigure gdm and select lightdm (you may need to reboot).


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

If you’ve attached an external hard drive to your system, then decided to use your partitioner to format it to EXT4 for greater efficiency (or just to match your Ubuntu system), you may have been shocked to find that your empty drive seemed to be missing a few gigabytes when mounted afterwards. And this has nothing to do with the good old binary (base-8) vs decimal (base-10) situation which would see your “750Gb” drive be more like 700Gb (in Windows and earlier versions of Ubuntu – now Mac OS X and Ubuntu have followed hardware manufacturers and use decimal, so that’s more like 738Gb).

This is because Ubuntu (and other Linux distributions) reserve typically around 5% of the space for the root user and system services, so should you run out of hard drive space, the administrator can still log in, and system services continue to run.

However, this is only really needed for your Ubuntu partition, so if you have an external EXT4 drive, or have an EXT4 partition on your internal drive (other than the one your system is on), you are needlessly wasting space (40Gb of the drive in the example). But you can free up that disk space quite easily, without having to re-partition the drive or anything. All it takes is a couple of commands pasted into the terminal.

In the following example, an external hard-drive will have the reserve set to 0 (zero), since this is what most people will need this for. First, we have to determine the device name, as using its mounted name – /media/700Gb Ext4 – won’t suffice. To do so, enter the following into the terminal:

mount|grep ^'/dev'

Look for the line containing your device:

/dev/sdc1 on /media/700Gb Ext4 type ext4 (rw,nosuid,nodev,uhelper=udisks)

… and you can see what it is named (/dev/sdc1 in this case). To free up reserved space, enter the following (replacing /dev/sdc1 with whatever the appropriate device name is, if need be – just make sure you don’t do it to your main drive!):

sudo tune2fs -m 0 /dev/sdc1

You should then be presented with the following message:

Setting reserved blocks percentage to 0% (0 blocks)

To confirm all has gone well, you can right-click an empty area of the folder window for the device and choose Properties, then compare the free space from before and after, or run the following command (once again replacing the device name with the correct one in your case):

sudo tune2fs -l /dev/sdc1 | grep 'Reserved block count'

You should be greeted with the following:

Reserved block count: 0

That’s it – you now have all of your drive to use.


Note: if you receive the following error message:

tune2fs: Bad magic number in super-block while trying to open /dev/sdb1
Couldn’t find valid filesystem superblock.

… then the filesystem likely isn’t EXT4 – chances are the drive is actually formatted as NTFS or FAT for use on Windows systems (which would be the case if you’ve bought an external drive, and never did anything other than copy files to it). You would have needed to partition/format the drive to EXT4, so if you didn’t, then you actually don’t need this guide.


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

If you’ve recently tried to upgrade legacy GRUB to the new GRUB2 bootloader, and things didn’t quite work out, you’ll find that upon the next boot this is as far as you get:

GRUB Loading stage1.5
GRUB loading, please wait…
Error 15

This is because the old GRUB is still in control of the boot process, but files that it needs are now missing. You may even have “Error 15: File not found!” at the end of the error message, but this is probably more likely if there is an incorrect device entry for the boot drive in GRUB‘s menu.lst config file. What will be covered here is the scenario that all is fine in menu.lst, and the reason for boot failure is that GRUB shouldn’t even be trying to initiate – since it was (for the most part) uninstalled when upgrading it to GRUB2 – and either a halted/unfinished install of GRUB2 is responsible, or specifying the wrong boot drive near the end of the install is responsible for all this.

If you’ve ever had to restore GRUB using the Ubuntu Live CD or something, you could be forgiven for thinking this is the easiest and fastest option to get things rolling again, but you may find it does nothing, since the boot process has become a mess of GRUB vs GRUB2, and things like “stage1.5” missing will hamper your efforts. Unlike with menu.lst, GRUB2‘s grub.cfg is not meant to be edited by the user, but is written to automatically as GRUB2 updates itself, and at any rate is probably not the issue. What needs to be done is to let GRUB2 finish installing itself (especially if it was halted/aborted), then make sure the correct boot drive/partition is specified. Easier said than done, you might say, but there are a couple of ways you can do this.

You can “chroot” into your system via a Live CD – basically meaning you can hack into it via the terminal and re-run the GRUB2 install that way – but many might find this daunting, and for some it just won’t work (at least with instructions I’ve seen around).

So what I propose is that you use the Super GRUB Disk to boot into your system, then run the install again. While this disc is for legacy GRUB, and (at least for me) was useless for reinstalling GRUB (I was ready to let it get rid of GRUB2 if it could), you can use it to boot a Linux system with a faulty bootloader, which will be your saviour.

Restart your computer with the Super Grub Disk, and while it is loading follow the prompts and hit Enter where asked. Once you end up at the first menu, choose the option for English. When you arrive at the main menu, choose “Advanced“, followed by “GRUB“.

Next, choose “Boot Your Gnu/Linux (or other OS) again“, followed by “Manual Boot“. You will need to choose the path for GRUB’s leftover files, and it should be the first option, “/boot/grub/menu.lst“.

At the next screen, “Partition lst“, pick the correct boot device (eg: “1.   hda   sda   hd0“) then the appropriate partition (eg: “2.   hda2   sda2   (hd0,1)   hd0s2“).

Next, a blue screen with return characters (bent arrows), each pointing to a smiley face, will be displayed; just hit Enter on the first one and your boot menu should now appear.

Don’t be surprised if you find that even though you picked to boot the old menu.lst it has loaded GRUB2 via grub.cfg. You should now be able to boot your system fine, so finish the installation/configuration of GRUB2 to prevent this happening again.

Click here to go to the SGD download page and pick a version for download, then burn it to CD (in Ubuntu, just double-click the file, or right-click and choose “Burn to Disc”). Please note that at the time of writing even though there is a new Super Grub2 Disk (v.1.30) made especially for GRUB2, due to some bugginess that has to be ironed out the developer recommends using the legacy disc (currently version 0.9799, but even earlier versions will work fine with GRUB2, as this guide was based on using 0.9536).


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »

If your system is slowly grinding to a halt, and multitasking is a nightmare, you may need to check your swap is in use. If you’re experiencing non-stop, furious hard drive activity resulting from even the most simplest tasks (like clicking another tab in your browser, or even something basic like minimising an app), with things you’ve initiated taking 2 minutes or more to appear, then open a terminal and enter top.

You’ll see “Swap” near the beginning, and if the total is 0k (that’s zero kilobytes), then that means your swap has been deactivated for some reason. To enable it again, start the Partition Editor (found in System > Administration; if it isn’t installed, enter sudo apt-get install gparted in a terminal to do so).

Locate linux-swap, right-click it, and choose Swapon. Your swap partition should now be in use, but if you have further hassles, it might pay to reformat (or even delete) the swap with GParted (ie: Partition Editor). To format it again, just right-click the swap and choose Format > linux-swap.

In case the swap appears on (even if not working), you will need to Swapoff to get the Format options. Similarly, if you decide to delete the swap and start again, you might need to turn it off first so the Delete option is available. The swap can then be recreated with the unallocated space it left when deleted, which you would then format as linux-swap.


Did this information make your day? Did it rescue you from hours of headache? Then please consider making a donation via PayPal, to buy me a donut, beer, or some fish’n’chips for my time and effort! Many thanks!

Buy Ubuntu Genius a Beer to say Thanks!

Read Full Post »