Tuesday, 17 November 2009

Howto: Stop Ubuntu 9.10 Karmic Mounting USB Devices With UUID Instead of a Name

Ubuntu 9.10 Karmic Koala changed the way USB devices get mounted a little bit. Instead of being mounted as /media/disk and then each other device becoming /media/disk-1, disk-2 and so forth, now the device is mounted with its UUID, a seemingly random string.

I never minded the disk-1, disk2 thing, though it was slightly annoying to not know which device was which sometimes it was seldom a problem as I had frequently just plugged it in and watched it mount. So the new change was a bt more of an annoyance as its harder to see which random string just appeared sometimes.

The solution as ever is pretty darned simple however, just label the device you lazy bum ;)

Pop along to the following page and read how to label different partition types, most likely fat16/32 or NTFS for your average thumbdrive of phone/mp3 player mounted as a mass storage.

https://help.ubuntu.com/community/RenameUSBDrive

Personally I use the Gparted method as mtools has an issue which means you have to add the device to a config file first (its detailed on the page) and while its not hard, its just an extra step I don't need.

So if you don't have Gparted installed already do the following or use Synaptic:

sudo apt-get install gparted

Start Gparted from the System/Administration menu, then select your device from the drop down list in the top right then unmount it by right clicking it in the lower frame and choose unmount. This is so you can make changes to it. Choose to "label" it from the same right click menu or from the Partition menu, finally you have to apply the changes by clicking the right most icon on the toolbar to "Apply all changes". It is done instantly and no longer will that device be known as /media/4169-87bb.

Sunday, 15 November 2009

Howto: Disable the 60 second delay in Logout/Restart/Shutdown

This new setting became a pet hate of mine within minutes of installing Ubuntu 9.10 Karmic Koala, there is a 60 second delay and confirmation dialog when logging out, restarting or shutting down. This default can be over-ridden to act instantly rather than waiting for 60 seconds or clicking a confirmation by setting the apps/indicator-session/suppress_logout_restart_shutdown boolean to true as follows:

gconftool-2 -s '/apps/indicator-session /suppress_logout_restart_shutdown' --type bool true


You can of course use gconf-editor if you want to use a GUI based tool, just navigate to /apps/indicator-session in the left tree and change the value of suppress_logout_restart_shutdown to enabled/ticked/true.



Wednesday, 4 November 2009

Howto: Adjust updatedb.mlocat to a sensible time.


All credit for this goes to This Blog Entry where I found this helpful information.

If you are an early riser like myself (well, occasionally at least) then you may notice your PC grinding away on its harddrives like a mad thing. I have around 3TB of storage so the problem is exacerbated somewhat. The process to blame is updatedb.mlocat which runs between 6am and 7am, I want a quiet morning with my coffee so I am going to show you how to move it to between 3am and 4am

The job parameters are listed in /etc/cron.daily/mlocate. We don't edit anything here, its just for reference.

#! /bin/sh

set -e

[ -x /usr/bin/updatedb.mlocate ] || exit 0

# See ionice(1)
if [ -x /usr/bin/ionice ]; then
IONICE=”/usr/bin/ionice -c3″
fi

$IONICE /usr/bin/updatedb.m

The files in /etc/cron.daily are kicked off by /etc/crontab, not by root’s crontab. For some reason, Ubuntu’s default install runs this process around 6am. Changing this file allowed me to make the job run at 3am. Here we change the hour time to 3 instead of 6, so you will need a sudo gedit or something to adjust this... carefully.. sudo gedit /etc/crontab

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don’t have to run the `crontab’
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
17 * * * * root cd / && run-parts –report /etc/cron.hourly
25 3 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.daily )
47 3 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.weekly )
52 3 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.monthly )
#


updatedb can be configured to ignore certain paths - since my machine has a number of drives used for backups, I wanted to exclude those from the updatedb job. I accomplished this by editing /etc/updatedb.conf and adding to the PRUNEPATHS listing. Adding paths to the PRUNEPATHS option instructs updatedb to exclude those paths from indexing.

PRUNE_BIND_MOUNTS=”yes”
PRUNEPATHS=”/tmp /var/spool /media /mnt/backup”
PRUNEFS=”NFS nfs nfs4 afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf rpc_pipefs”

Tuesday, 3 November 2009

Howto: Revert Update-notifier behaviour to old style

The new method of alerting users to updates seems ever so slightly hair brained to me, but what do I know. Well I do know I prefer the old method where I was alerted each day, not the new method of waiting 7 days to make the alert. And only being alerted then if 7days had passed since the last activity in apt!

Ok, here is the fast fix:

gconftool -s --type bool /apps/update-notifier/auto_launch false

Thats it, job done.