Posts Tagged ‘Linux Mint


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.


Share Files Between Mint 11 and Windows 7

Logo Linux Mint

Image via Wikipedia

While what I got today is nothing serious, nothing that has not been extensively documented elsewhere, I thought I’d sum up all the necessary steps in one place to save somebody the trouble of looking into many different websites to accomplice a relatively simple task.

The Story: I have three external drives on my PC (now running Linux Mint 11) that I needed to be able to access from a Windows 7 machine, serving the role of my Media Center. You can read why I chose Win7 for Media Center here.

The problem: I could not activate File Sharing on Mint. The option under “Preferences”, “Personal File Sharing” was grayed out.

The Solution: For some reason, completely unknown to me, you need to install a couple of Apache packages first. Insane, I know, but that’s what Jeffrey Charles suggested over at Beyond Technically Correct and I had no reason to doubt him. So open a terminal and type:

sudo apt-get install apache2.2-bin libapache2-mod-dnssd

After installation was finished, I rebooted my machine (not sure whether I needed to do that or not) and finally I was able to enable Personal File sharing. I went to my three disks, I created the shares and then I went to my Windows machine and tried to add them as network drives. Guess what? No luck. Fortunately, I remembered that the last time I had set up a Samba server, I needed to make a couple of changes in a file somewhere. In case you are wondering, when you check the checkbox to enable file sharing, what you really do is set up a Samba server on your machine.

You need to edit the following file to reflect your own network: /etc/samba/smb.conf

Locate the line bellow and change WORKGROUP to the name of your workgroup. If you never changed that, you do not need to do anything here.

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP
What I did next, was to scroll a bit down and locate the authentication section. Then, I uncommented the security = user line. Remember, if you do that, you need to make additional user accounts on your machine, for every other user you want to allow to access your shared folders.
# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
   security = user

The last step you need to take, is add the allowed users to Samba. Open a terminal and type:

sudo smbpasswd -a [username]

Please note that in case you enabled the security = user option above, you will have to provide a username that can also log on to your machine. I added myself for example.

Edit: I forgot to mention that after you change the configuration file you need to restart Samba, for the changes to take effect. you can do that by typing in a terminal “sudo service smbd restart” or by restarting your machine.

That’s it. I was then able to access my drives from Windows and mount them as Network drives.

July 2017
« Sep    

Yeah, I got one o’ those…

  • Θέλω να πιστεύω ότι υπάρχει κάποιος λόγος που το Paypal δεν μου εγκρίνει την πληρωμή στο Steam με Visa debit της @Alpha_Bank. 10 months ago
  • RT @JohnPliotas: Θα γίνει πόλεμος με #Τουρκια αύριο και τα ελληνικά sites θα ανεβάζουν άρθρα "δείτε τα 20 καλύτερα tweets για την κήρυξη το… 1 year ago
  • @ZERSOFIA σωστά πρέπει το κοινό να έχει επιλογές 1 year ago
  • Εν τω μεταξύ στην ΕΤ2 δεν έχουν πάρει χαμπάρι . 1 year ago
  • @koukos Προς το παρόν OneNote γιατί ήταν εύκολο να μεταφέρω όλα μου τα notes εκεί. Θα δω όμως. 1 year ago