Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed a new hard drive and partitioned some space that I am wanting to use for keeping my Music files on. I have entered a line into the /etc/fstab file that I believe mounts the partition properly, but it is giving root owner ship of the partition.

Is there a better way of doing this? perhaps mounting the drive some where else and using a hard link?

the line I have so far in my fstab is

/dev/sdb1 /home/me/Music ext4 defaults,user 0 2

But this is still sowing the drive on my desktop, it also replaces the the name of Music in my places with the fact that it is a drive of such a size.

share|improve this question
up vote 2 down vote accepted

If it's ext4 then it has uid, gid and permissions, even at the root.

From what you say, it suggests that the root directory of the /dev/sdb1-filesystem belongs to root.

You could try three possible solutions:

  1. Just replace ext4 defaults,user 0 2 by ext4 defaults 0 0, reboot and see what happens.

  2. Change the owners and permissions of this partition (if mounted, sudo chown me:me /home/me/Music && sudo chmod 755 /home/me/Music)

  3. Mount /dev/sdb1 elsewhere, like /mnt/foo, create a directory called Music inside it, and mount /mnt/foo/Music in /home/me/Music in bind mode. If it works well, this is the fstab:

    /dev/sdb1      /mnt/foo       ext4 defaults      0 0
    /mnt/foo/Music /home/me/Music none defaults,bind 0 0
    

I'm assuming you are not mounting anything on the top of /home/me, like an encrypted home for instance. You didn't say either if you will always have this device plugged when you boot. If you want to have a "hot-pluggable Music folder" then you should expect that Gnome will show it as a pluggable device.

share|improve this answer
    
yer, it is a HDD in my PC so will walys be there. If I go down the road of the third option there, will I see the drive on my desk top? – thecoshman Sep 6 '10 at 13:04
    
You'd better try them in order. But finally Yes, in the 3rd option, as it will be already mounted by root, this specific partition will not appear in your Desktop. – user39559 Sep 6 '10 at 13:32
    
Solution one solved my problem, I now have that partition mounted to my music folder. I now have a slight iritation. When I click places from the top menu, rather then "Music" I get "40Gb File system", still opens my music folder correctly though. I also have a link to the "40Gb File system" on my desktop. Am I right in saying that only through solution 3 will I be able to solve "hide" the partition from my day to day view? (no icon for the partition on my desktop and listed as music in "places") – thecoshman Sep 6 '10 at 15:30
    
Is it also mounted in /media? Normally only stuff in /media appears in the Desktop. Are you sure it's the music partition there? When you run "mount" does it tell you that /dev/sdb1 is also mounted elsewhere? What happens when you double-click it on the desktop? Also, when you run "ls -l ~", does Music appear as "drwxr-xrx- me:me ... Music" ? – user39559 Sep 7 '10 at 11:48
    
in the end, I went for the your third suggestion. the drive was also getting mounted in /media originally. The only difference was that for the second line in fstab I just went '/mnt/foo /home/me/Music'. This solution is probably the way I should have gone at first, simplest really I think. – thecoshman Sep 7 '10 at 14:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .