Wednesday, November 12, 2014

HOW-TO: Automount partition(s) in Ubuntu

In this article I'll show You how to automatically mount a partition on system start up. In Ubuntu this is not something You must to do if You want to access Your "other system" or "data" partition because Ubuntu has simplified system for that purpose. In other Linux systems, like i.e. Slackware or Arch, this is very usefull because there You need to enter Your root password to access other partitions. But, there is no impediments to do this in Ubuntu, too.

The file we interested in is /etc/fstab.












Step 1


Get UUID of desired partition You want to automount. Simply call blkid as root in terminal: 

sudo blkid

This will list all Your partitions with their UUIDs.


Step 2


Create folder in which You will mount desired partition. I prefere /media/FOLDER location for mounting other partitions. Replace FOLDER with desired name.

sudo mkdir /media/FOLDER

Step 3


Open /etc/fstab in Your favourite text editor and see the picture before Step 1, in this article.
First, enter description for the partition. Do it in comment mode. Put # in front of descrition, so the line will be interpretedlike a comment, not code.
You may notice on the picture, the third line from bottom, some columns:

<file system>  <mount point>   <type>    <options>     <dump>      <pass>

This will help You to correctly enter all necessary informations in the file. Separate columns with TAB key.

<file system>

Partition or storage device to be mounted. Here You can add partition like i.e. /dev/sda2 or You can add UUID like on the picture.

<mount point>

Directory (mountpoint) where <file system> is mounted to. In our example - /media/FOLDER

<type>

The <file system> type, like ext3, ext4, ntfs, btrfs and so on.

<options>

Mount options of the filesystem to be used. See all mount options. Don't be afraid, in almost all cases it'll be defaults.

<dump>

Used by the dump utility to decide when to make a backup. If "0", dump will ignore the file system. If "1", dump will make a backup.

<pass>

Used by fsck to decide which order filesystems are to be chacked. Possible values are 0,1 and 2. Root filesystem should have the highest priority - 1. Other filesystems should have lower priority - 2. If "0", filesystem will not be checked by fsck.



Well, the line should have look like this:

UUID=your_uuid             /media/FOLDER             ext4             defaults            0             1

Save the file.

Step 4

Open terminal and mount all entered partitions.

sudo mount -a

Then, check if everything went good.

cd /media/FOLDER
dir

If You see appropriateitems, everything is OK.

From now on, everytime You start Your system, the partition(s) will be automatically mounted.


Monday, November 10, 2014

Remove items from sound indicator in Unity panel (troubleshooting) ::: Ubuntu 14.04

As You know, when some audio/video app is open, relevant item appears in sound indicator in Unity panel. Item(s) stays there forever. For me, it can be annoying. There is a way to remove it from sound indicator, but sometimes it is impossible to do it successfully. Why, I don't know.














Here I'm going to show You how to remove items from sound indicator in Unity panel. Regular way is to use dconf-editor. Simply, open the app and navigate to
com/canonical/indicator/sound.





















When You start i.e. Rhythmbox music player, it appears in interested-media-players line. You need to reset this to default value, so sound indicator will be cleaned after system reboot. Further, if You want to prevent Rhythmbox from showing in sound indicator, simply put 'rhythmbox' value in blacklisted-media-players line above (first line).

What to do if this does not work? 


From some reason, this does not work for me. So I need to manually reset intersted-media-players parameter every time when logged in Ubuntu. I found another way to do this. I wrote a script for this task and put it in Startup Applications, so it runs automatically every time I logged in Ubuntu.

#! /bin/sh
#
# Reset interested-media-players parameter in
# dconf-editor

set -e

gsettings reset com.canonical.indicator.sound \
interested-media-players

exit 0

I called it reset_interested_media_players.sh. You can call it whatever You want. You need to make it executable.

sudo chmod +x SCRIPT

And You need to put it in Startup Applications, so it runs every time You log in Your system.
















In Command space, enter the following:

sh -e /script/location/SCRIPT.sh

Change script location and SCRIPT.sh with appropriate values. That's it... It's not a big thing, but it does the job.

Saturday, November 8, 2014

Friday, November 7, 2014

Change mouse click behavior and add DELETE action in Nautilus context menu

Big majority of computer users used to open files and folders by double click on mouse. But, there is option to change mouse behavior, so You can open files and folders by single mouse click. There are many pros and cons about this behavior, all depends of a user and his/her habits, ways of computer using.

In example, it's good for faster opening files and folders, but it's not good for previewing files in Nautilus, because You must click on a file (select it), so You can preview it. This can slow all the operation, because You can not click on a file (this will open the file), but You need to select it.
I am going to show You how to change this behavior and You decide whether You'll change it or not.

Open Nautilus and head for Edit->Preferences and choose Behavior tab. In the first section, Behavior, You can change mouse click behavior, by choosing Single click to open items.
















I was long-time KDE user and I loved very much this feature in KDE. But, Unity differs from KDE and here the option isn't that usefull like in KDE.

As You can see, in the same tab is other options. There is also option for adding DELETE action in Nautilus context menu. Look for it in Trash section, at the end of the tab. Just mark the box before Include a Delete command that bypasses Trash.

This is very usefull (for me), because I don't like moving files to Trash and then click to Empty Trash. Boring to me... By including the command in Nautilus context menu, You will be able to bypass Trash. My advide to You is not to uncheck previous option, Ask before emptying the Trash or deleting files. It's a good safety measure.