Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
I am new to linux and I'm sorry if it shows. I have a fat32 hard drive and i'm having a problem with mounting it. I looked at some of ...
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Posts
    18

    FAT32 and mounting

    I am new to linux and I'm sorry if it shows. I have a fat32 hard drive and i'm having a problem with mounting it. I looked at some of the other posts, and I have found a way to mount it. My problem is that while I can read it, I can't write to it. I've tried using the chmod command, but I still can't write to it... anyone have any ideas how to write to it?

  2. #2
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Location
    Riverton, UT, USA
    Posts
    1,001
    What command (or fstab entry) are you currently using to mount it?
    Stand up and be counted as a Linux user!

  3. #3
    Just Joined!
    Join Date
    Aug 2006
    Posts
    18
    I am currently using

    mount -t vfat /dev/sda1 /home/HD

    to mount it.

    As for fstab, I have not done anything to it yet.

  4. #4
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Location
    Riverton, UT, USA
    Posts
    1,001
    I'm assuming you're giving that command as root, since normally only root can mount a filesystem. And then I'm guessing that the read/write problems occur for your normal user account, correct? And if you try to read/write as root, it works?

    If the above is true, then you have a couple of options. One is to add a umask option to your mount command, as discussed in this thread. Note that it's easiest to do it in your fstab once you start adding options. The other method is creating a group called disk (if there isn't one already), making your normal user a member of the disk group, and adding a gid option to the mount command. But even then you may need a umask to allow the group r/w privileges Using gid and umask together is still more secure than just using a umask that lets everyone write to the disk, so if security is a concern then that's probably the way to go.
    Stand up and be counted as a Linux user!

  5. #5
    Just Joined!
    Join Date
    Aug 2006
    Posts
    18
    I decided to try this by changing fstab, but I don't think I am doing this right. This is what I have in fstab to mount the hard drive:

    /dev/sda1 /home/HD ntfs ro,users,owner,umask=0000 0 0

    And it is neither mounting it during boot up, nor is it letting me write to it when I mount it manually. It's probably because I didn't put it in the right place or something, or I hope it's just that. As I said before I'm very new to this, what tiny little thing did I do wrong?

  6. #6
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Location
    Riverton, UT, USA
    Posts
    1,001
    Two things jump out. The fstab line has ntfs as the filesystem type, but earlier you had it down as vfat. If you specify the wrong fs type, it won't work. Next, your first fstab option is ro, which means read-only. That prevents you from writing to the mounted partition. Also, the owner option probably isn't needed, unless your regular user is the owner of /dev/sda and you just don't want other users to be able to mount it.
    Stand up and be counted as a Linux user!

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    hi me259259 !!!

    Quote Originally Posted by me259259
    /dev/sda1 /home/HD ntfs ro,users,owner,umask=0000 0 0
    this should be ...

    /dev/sda1 /home/HD vfat rw,defaults,umask=0000 0 0

    <=== { casper } ===>
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  8. #8
    Just Joined!
    Join Date
    Aug 2006
    Posts
    18
    Ok, this is now what is in fstab:

    /dev/sda1 /home/HD vfat rw,defaults,umask=0000 0 0

    Not only is it not mounting on startup, I still can't write to the disk. It has vfat, it's not rw, and now not just owner. wait... what?

  9. #9
    Linux Engineer Zelmo's Avatar
    Join Date
    Jan 2006
    Location
    Riverton, UT, USA
    Posts
    1,001
    What I'm gathering from the mount and fstab man pages (and memory from when I had a shared vfat volume) is that your mount options only need to include defaults, auto, and umask. So you should have something like this:
    Code:
    /dev/sda1   /home/HD   vfat   defaults,auto,umask=0000   0   0
    The rw option is part of the defaults; auto tells it to mount when 'mount -a' is called, which is what happens at bootup.
    Stand up and be counted as a Linux user!

  10. #10
    Just Joined!
    Join Date
    Aug 2006
    Posts
    18
    ;k, this is what is in there:

    /dev/sda1 /home/HD vfat defaults,auto,umask=0000 0 0

    And it is still not mounting on boot, or making it readible when I mount it myself. Though I guess the real problem is that it's not mounting at boot. If it was mounting at boot, it would use fstab, and by mounting it myself, it doesn't really change anything does it?

    So maybe we should go in the other direction of why it is not mounting at boot

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •