KDE 4.2 Dolphin automount NTFS on boot

Compiz, KDE, Gnome, Fluxbox, etc...

Moderator: Moderators

KDE 4.2 Dolphin automount NTFS on boot

Postby Valkyrie » Sat Feb 14, 2009 16:44

Hello,

I am quite new to Linux and to KDE. When I have booted my PC, Dolphin shows both my NTFS disks in the "Places". The disks aren't mounted yet. In order to mount them, I have to click them first in Dolphin. So, if Dolphin can mount my disks with a simple click, how can I get Dolphin to do it by its self on boot. I've tried to find the option in Dolphin and in the KDE menu, but with no success. It would be very logical for the option to exist. I have tried to google it, but people start talking about doing stuff in fstab and mount points and whatever. Can anyone tell me what I need to do to get these disks "clicked upon" by boot (i.e. mounted)?

Thank you.
Valkyrie
Baby Hen
 
Posts: 6
Joined: Fri Jan 30, 2009 21:09

Re: KDE 4.2 Dolphin automount NTFS on boot

Postby Fitzcarraldo » Sat Feb 14, 2009 18:34

Well, there's a good reason people start talking about fstab: that's the sensible way to do it.

Just do the following:

Open a Terminal window, enter the command su and login as the root user:

Code: Select all
$ su
Password: <--- type the root user's password here and hit Enter
#

Then use the blkid command to see what device your NTFS drive is seen as:

Code: Select all
# blkid
/dev/sda1: LABEL="PQSERVICE" UUID="0E4E-05CE" TYPE="vfat"
/dev/sda2: LABEL="ACER" UUID="320D-180E" TYPE="vfat"
/dev/sda3: UUID="6922fb8c-6ba1-4657-97a9-a640eb8e6537" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda5: UUID="e19b8c79-b65e-46bf-9273-abd228d7eec2" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda6: UUID="2322ac6a-3f45-451a-a57a-a88f63d41e8b" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda7: TYPE="swap" UUID="f6c9d273-f339-4d21-be63-ca64bcb88534"
/dev/sdb1: UUID="9884B0A684B08870" LABEL="SEA_DISC" TYPE="ntfs"
/dev/sdc1: UUID="E8E8ED01E8ECCEBE" LABEL="IOMEGA_HDD" TYPE="ntfs"
/dev/sdd1: LABEL="IHP100" UUID="1B05-1B41" TYPE="vfat"

Notice that my two NTFS drives SEA_DISC and IOMEGA_HDD are devices /dev/sdb1 and /dev/sdc1 respectively.

Let's say that I want my NTFS drive SEA_DISC (/dev/sdb1) to be mounted automatically upon boot. Type the following commands into your open Terminal window (substituting, of course, the drive label for yours):

Code: Select all
# mkdir /media/SEA_DISC  <--- This creates a mount point called "SEA_DISC" for your drive.
# locale -a  <--- This lists the locales (countries and languages) currently configured on your PC
# nano /etc/fstab  <--- This runs the text editor Nano to open the fstab file

(Nano is an easy-to-use text editor that does not need a GUI to run. You'll see the commands it accepts listed along the bottom of the Terminal window.)

So I would add the following line to the end of my fstab file:

Code: Select all
/dev/sdb1 /media/SEA_DISC ntfs-3g defaults 0 0

If you use a language that uses diacritics -- let's assume you use French, for the sake of argument -- and you have that locale configured on your PC (as shown above, enter the command locale -a to find out what locales are configured on your PC), then you'll want to be able to save filenames with diacritics. In that case, you can add the locale to the new fstab command like so:

Code: Select all
/dev/sdb1 /media/SEA_DISC ntfs-3g defaults,locale=fr_FR.utf-8 0 0

(If the output of the locale -a command earlier was fr_FR.UTF-8 then I would type fr_FR.UTF-8, but if it was fr_FR.utf-8 then I would type fr_FR.utf-8)

Reboot and you'll find that your NTFS drive is automatically mounted.

Now, notice something called a 'UUID' in the output from the blkid command I posted above. UUID stands for 'Universally Unique Identifier'. If your NTFS drives are external and connected via USB, and you sometimes plug USB pen drives or other hard drives into your PC, you may find (just like under Windows) that your NTFS drive is no longer seen as the same device (e.g. in my case no longer /dev/sdb1). However the UUID should stay the same. So I could refer to the drive by its UUID instead in my fstab file, like so:

Code: Select all
UUID=9884B0A684B08870 /media/SEA_DISC ntfs-3g defaults 0 0

or, e.g.
Code: Select all
UUID=9884B0A684B08870 /media/SEA_DISC ntfs-3g defaults,locale=fr_FR.utf-8 0 0

To summarise, here's what my original /etc/fstab file looked like:

Code: Select all
UUID=2322ac6a-3f45-451a-a57a-a88f63d41e8b /                       ext3    user_xattr,commit=60,noatime,nodiratime      1 1
UUID=e19b8c79-b65e-46bf-9273-abd228d7eec2 /home                   ext3    user_xattr,commit=60,noatime,nodiratime      1 2
UUID=6922fb8c-6ba1-4657-97a9-a640eb8e6537 /boot                   ext3    user_xattr,commit=60,noatime,nodiratime      1 2
/dev/shm                                  /dev/shm                tmpfs   defaults                                     0 0
UUID=f6c9d273-f339-4d21-be63-ca64bcb88534 swap                    swap    defaults                                     0 0

and here's what it would look like after my edit (this time with the locale en_GB.utf-8 as an example):

Code: Select all
UUID=2322ac6a-3f45-451a-a57a-a88f63d41e8b /                       ext3    user_xattr,commit=60,noatime,nodiratime      1 1
UUID=e19b8c79-b65e-46bf-9273-abd228d7eec2 /home                   ext3    user_xattr,commit=60,noatime,nodiratime      1 2
UUID=6922fb8c-6ba1-4657-97a9-a640eb8e6537 /boot                   ext3    user_xattr,commit=60,noatime,nodiratime      1 2
/dev/shm                                  /dev/shm                tmpfs   defaults                                     0 0
UUID=f6c9d273-f339-4d21-be63-ca64bcb88534 swap                    swap    defaults                                     0 0
UUID=9884B0A684B08870                     /media/SEA_DISC         ntfs-3g defaults,locale=en_GB.utf-8                  0 0


Here's a good, easy-to-understand guide to fstab: How to edit and understand /etc/fstab
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8077
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: KDE 4.2 Dolphin automount NTFS on boot

Postby smardy » Fri Feb 20, 2009 15:00

That is a lot less complicated than it looks. It bothers me each time I reinstall
I'm with him though, why can't it just auto mount the disks.
surely if we can add one line to the fstab per disk/partition eg.
/dev/sdb2 /media/windowsstore ntfs-3g defaults 0 0
and do mkdir /media/windowsstore

It must be able to discover the sdb2 recognise it as ntfs, in this case.
the only variable is the directory it gets mounted at --- /media/windows bit.
I'm no programmer, but as it is totally arbitrary it could be the partition label
/dev/sdb2 /media/partitionlabel ntfs-3g defaults 0 0
save exit
then terminal mkdir /media/partitionlabel

Therefore I conclude it is being left off deliberately to make people learn how to edit and configure linux. I'm prepared to do it, and like learning, but this attitude is never going to bring more people to linux.
smardy
Simple Hen
 
Posts: 56
Joined: Tue Sep 25, 2007 21:57

Re: KDE 4.2 Dolphin automount NTFS on boot

Postby sjieke » Fri Feb 20, 2009 16:27

I'm not 100% sure, but I thought that if you choose the manualy partition option during the install process, you can specify additional mount points and assign partitions to it. This way the fstab gets created for you and the configured partitions are auto mounted.
sjieke
Technological Hen
 
Posts: 321
Joined: Thu Mar 01, 2007 10:46
Location: Maldegem, Belgium

Re: KDE 4.2 Dolphin automount NTFS on boot

Postby Fitzcarraldo » Fri Feb 20, 2009 19:31

Or there's a GUI front-end called ntfs-config (Automount NTFS drives in Linux - Tutorial) but, even as a long-time GUI user myself, it seems unnecessary overkill to use a GUI just to perform three simple commands:

If you're wondering what this lovely application does, well, it translated your mouse clicks into a series of commands.

Here's the set of commands that would have made the same result, when mounting Windows:

Code: Select all
sudo mkdir /media/Windows
sudo echo "/dev/sda1 /media/Windows ntfs-3g defaults,locale=utf8 0 0" >> /etc/fstab
sudo mount -a

This, more or less, fits the bill. There are other options available, but you get the same results.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8077
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: KDE 4.2 Dolphin automount NTFS on boot

Postby smardy » Fri Feb 20, 2009 19:40

Interesting I'll have a look at that next install. :D
smardy
Simple Hen
 
Posts: 56
Joined: Tue Sep 25, 2007 21:57

Re: KDE 4.2 Dolphin automount NTFS on boot

Postby Storm Rider » Sun Jan 30, 2011 21:20

Thanks Fitzcaraldo. That worked perfectly.
Storm Rider
Simple Hen
 
Posts: 74
Joined: Thu Dec 14, 2006 10:24

Re: KDE 4.2 Dolphin automount NTFS on boot

Postby yogieza » Tue Feb 01, 2011 1:02

nice post brother :-D ,i wanna try to my sabayon :mrgreen:
yogieza
Baby Hen
 
Posts: 11
Joined: Sun Dec 26, 2010 6:41
Location: Indonesia

Re: KDE 4.2 Dolphin automount NTFS on boot

Postby msdobrescu » Sun Nov 13, 2011 15:10

Hi,

In my case, with a fresh K 7 fully updated, my user can't mount the disks, as root does.
Is it possible to configure in a way that my user, or any other, could access /dev/sda1?
In the previous installation it was possible to mount it at the first access.
How is that possible?
msdobrescu
Old Dear Hen
 
Posts: 520
Joined: Sun Aug 21, 2011 8:48

Re: KDE 4.2 Dolphin automount NTFS on boot

Postby res0r9lm2 » Sun Nov 13, 2011 15:30

to make mountable by users can add defaults,user or defaults,users the latter allows a user other then the one who mounted partition to be able to umount it.
res0r9lm2
Simple Hen
 
Posts: 44
Joined: Mon Oct 24, 2011 17:52

Next

Return to 3D Desktops and Window Managers

Who is online

Users browsing this forum: No registered users and 1 guest

cron