04
Oct
11

Mounting External HDDs at Startup on OpenSuse

OpenSUSE 11.2

Image via Wikipedia

Although Linux Mint will be my favorite flavor of Linux, I am trying hard to give OpenSuse a chance. Last month, I was telling you about a couple of small annoying things I came across on OpenSuse and how to “correct” them. Since then, I switched back to Mint and back to OpenSuse (since yesterday) and I’m hoping to stick to one particular OS for a while, because frankly, it’s becoming some kind of habit…

Anyway, back to our topic. Now I know what most of you are thinking: “Why the hell do we need instructions on how to mount an external HDD? Since the Dark Ages, you have your standard plug n play on Linux mister! Pop it in and all your files are there!” Well, yes, but as it usually happens, mine was a slightly different case than usual. Yeah I know, I got to do something about it.

I have three external hard disks, which host most of my entertainment. These are permanently hooked on my PC and I want them shared via Samba, so I can access them through a Windows 7 box that acts as my current Media Center. For an explanation on why I am using Windows and not XBMC with Linux, have a look at this post. As you probably guessed, the disks are formatted in NTFS and this is what complicates matters.

In case my disks were formatted in a Linux format, such as ext4, things would be simple enough: I would choose to automount them in KDE (I think Gnome has a similar option) and every time I turned my PC on, they would be mounted in /media folder under folders matching their label. Then, I could set up file sharing as usual and everybody would be happy.

NTFS, does not support the same permissions as extended file system. This means that upon mount, Linux applies “fake” file permissions which you cannot change! If you were using ext4 for example, you could easily chmod the files to suit your needs, but in this case, although chmod will report nothing strange, no actual changes were made. Even so, for most of you this will not be a problem, since you will be the only one using this disk and by default you are the owner, so you can do pretty much everything. In my case, I wanted to be able to allow read/write access not only to myself, but to all members of my group too. So here’s what I did:

Since automount through KDE was not good for me, I had to do it the old fashioned way, by adding entries in fstab. First I created a folder for each of my drives under root and gave them the appropriate permissions:

sudo mkdir /Videos
sudo chown -R rosenred /Videos
sudo chgrp -Rv users /Videos

Now, we need to add the mount commands in fstab. The safest way to go, is with each disk’s uuid, a unique identifier that will remain stable even if drive letters change. So we need to find our what is the uuid of our disk:

sudo /sbin/blkid

In case you followed my advice (or are using a different distro) you don’t need to add the /sbin to the command. Write down the uuid of your disk and then edit /etc/fstab using your favorite editor and add the following line:

/dev/disk/by-uuid/7A7ACDEA7ACDA2ED /Videos       ntfs-3g users,locale=en_US.utf8,uid=rosenred,gid=users 0 0

If you wish to add more than one disks, add more lines to fstab accordingly. Reboot and hopefully everything will work just fine.

I don’t plan on writing a separate post about how to configure Samba, there are a ton of tutorials on the subject, however I have one tip that might save you a lot of money from a broken screen/desk/wall:

If you set everything up and for some reason Windows refuses to see the shared directories, go to YAST and disable AppArmor. I know, makes little sense, but apparently it’s a bug in OpenSuse 11.4 as I found out here.

About these ads

2 Responses to “Mounting External HDDs at Startup on OpenSuse”


  1. 1 Emilio Garcia
    January 12, 2012 at 10:02 pm

    Hi, thanks a lot!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


October 2011
M T W T F S S
« Sep   Dec »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Yeah, I got one o’ those…

  • RT @EvAk0_Mou_: Μημε ξυπνάς απτιςεξι Έχω ξυπνήσει μόνη μου απ'τις τέσσερις.**#@@##**#@@ 2 hours ago
  • Κόφτε ρε τις καλημέρες γιατί θα φύγω και θα πάω στο Ello που είμαι μόνος μου να μην σας διαβάζω. 2 hours ago
  • Ότι όλοι εσείς που εύχεστε καλή βδομάδα κάθε Δευτέρα το πιστεύετε ας πούμε. 2 hours ago
  • Εν έτει 2014 παλεύουμε ακόμα για να μην υπάρχει ρατσισμός κι ο Σεφερλής βάφεται μαύρος "για να γελάσουμε". 22 hours ago
  • @Leia_OSolo Τσέκαρε και το G+ του ;) plus.google.com/u/0/1034991861… 1 day ago

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: