Announcement

Collapse
No announcement yet.

need fstab help [Jaunty]

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    need fstab help [Jaunty]

    I have a separate 60g drive [sdb1] that used to be my Kubuntu system drive- it has been replaced with a 320, but I would like to delete all of it but /home (to save data files)

    fstab says
    /dev/sdb1 /media/sdb1 auto users,atime,auto,rw,nodev,noexec,nosuid 0 0

    I've looked at [man mount] and variously Googled, but can't find an explanation of the
    Code:
    users,atime,auto,rw,nodev,noexec,nosuid 0 0
    part, and what to change to make it user-owned.

    any link to rub my nose on would be greatly appreciated :-)
    WE&#39;RE ALL BETTER OFF WHEN WE&#39;RE ALL BETTER OFF<br />User # 17645

    #2
    Re: need fstab help [Jaunty]

    Hi Tom,

    No nose-rubbing here! I've just spent a few days learning about fstab to get a home server working. I'm not entirely sure what you mean by 'user owned', but I'm guessing you mean you want it set up so that any user registered on the computer can access it?

    I found the link here useful when I was setting my fstab up. Those various labels in the fstab line just describe how the disk will be attached. For example 'rw' means you will be able to read and write data; 'noexec' prevents you from executing programs that are stored on the disk.

    I suspect all you really need, if you want most users to access the disk, is to include the 'users' option. I might be slightly out (so please do correct me if I am, people) but I think the following should work for you:

    /dev/sdb1 /media/sdb1 auto auto,user,exec,rw,async,suid 0 0

    the 'user' entry allows all users to mount the disk, which is what I think you want. In terms of whether all users can use the disk, this is primarily a permissions issue - you need to set the permissions to restrict or allow access to what's on the disk.

    For more information on fstab, I found it useful to search Google for 'fstab option' - so, for example, when I wanted to know what exec meant, I googled 'fstab exec' and nearly always went right to the answer.

    Edit: I've just noticed my fstab uses 'users' rather than 'user', so you might want to follow that.

    Comment


      #3
      Re: need fstab help [Jaunty]

      Originally posted by olembe
      I'm not entirely sure what you mean by 'user owned', but I'm guessing you mean you want it set up so that any user registered on the computer can access it?
      so that any user can delete directories/files, create new ones- yes

      I found the link here useful
      I had found that one- it didn't have a lot of my parameters listed, and I'm learning to be a cautious sort (having toasted this on more than one occasion ... :-)

      I think the following should work for you:
      /dev/sdb1 /media/sdb1 auto auto,user,exec,rw,async,suid 0 0
      I made change as thus:
      Code:
      # /dev/sdb1 /media/sdb1 auto users,atime,auto,rw,nodev,noexec,nosuid 0 0
      /dev/sdb1 /media/sdb1 auto auto,user,exec,rw,async,suid 0 0
      but it made no difference after a reboot: still listed as
      Code:
      drwxr-xr-x 22 root root 4096 2008-08-15 22:44 sdb1
      WE&#39;RE ALL BETTER OFF WHEN WE&#39;RE ALL BETTER OFF<br />User # 17645

      Comment


        #4
        Re: need fstab help [Jaunty]

        Tom: what are you expecting to see? Is it the 'root root' that's the problem? If so, your problem isn't with fstab, but rather with ownership. My external disk is owned by root just the same as yours. But my wife and I happily have our own spaces on it. That is, although my disk as a whole is owned by root, just the same as yours, the files in my own directory (/media/sdb1/ian) are owned by me. It sounds like you just need to give each of your users their own space on the disk. So, for example, you can create a folder on your external disk called tom, and make it belong to yourself. I'm assuming your username is tom. If so, you'd type:

        sudo mkdir /media/sdb1/tom
        sudo chown -R tom:tom /media/sdb1/tom

        from then on, you can access everything in /media/sdb1/tom when you're logged in as tom without worrying about it, and without having to use the sudo command.

        You could do the same thing to create spaces for other users. If you wanted to create a space for a friend called Joe, you'd create a user account for 'joe' on your computer (using the adduser command) and give him a space on the external disk the same way:

        sudo mkdir /media/sdb1/joe
        sudo chown -R joe:joe /media/sdb1/joe

        Each user has their own folder, which belongs to them. They can do whatever they want inside their own folder whilst logged in as themselves. The root directory /media/sdb1/ is owned by the root user, however, so if you want to do anything in that directory you'll need to preface the command with sudo.

        I hope I've explained that clearly enough!

        Comment


          #5
          Re: need fstab help [Jaunty]

          Originally posted by olembe
          Tom: what are you expecting to see?
          This
          <http://users.eastlink.ca/~td/snapshot.png>
          is what it looks like to me: I think it was Hardy or earlier.

          I want to nuke every directory that's there, with the exception of /home (which I want to archive then move on
          WE&#39;RE ALL BETTER OFF WHEN WE&#39;RE ALL BETTER OFF<br />User # 17645

          Comment


            #6
            Re: need fstab help [Jaunty]

            Ah! I see. So sorry if this sounds stupid, but why can't you just delete the folders you don't want? You can clearly seem them all to get that screenshot, so why not just delete everything but the home folder? Perhaps back them up first just in case?

            cd /
            sudo tar cvzf /media/sdb1/* sdb_backup.tar

            Is it that you're worried there's system software there? If your computer boots without this external disk plugged in, it doesn't need the stuff on there so it's fine to zap it.

            Comment


              #7
              Re: need fstab help [Jaunty]

              tom_d@ See Understanding fstab
              Windows no longer obstructs my view.
              Using Kubuntu Linux since March 23, 2007.
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment


                #8
                Re: need fstab help [Jaunty]

                Originally posted by olembe
                Ah! I see. So sorry if this sounds stupid, but why can't you just delete the folders you don't want?
                because the whole drive is root-owned and I can't do anything to it until I get it user-owned

                Is it that you're worried there's system software there?
                not at all- it's an old install from many versions ago- all I want is the /home directory and the entire drive available to me (the only user) to write to
                WE&#39;RE ALL BETTER OFF WHEN WE&#39;RE ALL BETTER OFF<br />User # 17645

                Comment


                  #9
                  Re: need fstab help [Jaunty]

                  Originally posted by tom_d
                  Originally posted by olembe
                  Ah! I see. So sorry if this sounds stupid, but why can't you just delete the folders you don't want?
                  because the whole drive is root-owned and I can't do anything to it until I get it user-owned
                  Right! I See. No problem. Actually you totally can do things to your disk right now. If you start any command with 'sudo' you temporarily BECOME root whilst that command is carried out. So your answer is either to hand the disk over to your user account:

                  sudo chown tom:tom /media/sdb1

                  ('chown' is the 'change owner' command.)

                  Or the better solution is just use sudo to delete the files on the disk:

                  sudo rm -r <the files you want to kill>

                  It is usually best if the disk remains owned by root, as this makes it easier to avoid accidentally damaging things and prevents users creating files outside their own allocated space. Users can still have their own folders on the disk as I described above in an earlier post. I'd recommend leaving the disk with root ownership and using sudo to temporarily become root when necessary, whilst creating a /home/tom area that you hand over to your user account with the chown command. This is how my external disk is set up and it works just fine.

                  Comment


                    #10
                    Re: need fstab help [Jaunty]

                    Originally posted by olembe

                    It is usually best if the disk remains owned by root
                    Quite right. The default (and desirable) system has root ownership of "devices" including hard drives, and users are "authorized" to use them, with permission settings. And we should speak of "partitions", not drives -- even an entire drive is only usable as a partition.

                    So, rather than fight the default root ownership of the hard disk drive, make some data folders on it (or the applicable partition), as "sudo" or root, and then change the permissions on the folders to set the owner and group as your user. To do it graphically, it is easily done with dolphin, for example, Alt-F2 "dbus-launch kdesudo dolphin" and then browse to the partition, make a new folder, right-click the new folder, choose "properties" and "permissions" and change them, and "x" the box that says "apply to subdirectories". That should do the trick.

                    btw don't get carried away while dolphin is in root mode -- stay far away from your user folder, please.

                    Comment

                    Working...
                    X