Announcement

Collapse
No announcement yet.

Cannot write to second internal hard drive

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

    Cannot write to second internal hard drive

    [SOLVED] Someone else has undoubtedly had this problem, but I cannot yet figure out how to search the forum's redone site for past posts. Apologies to all.

    I have installed a second internal hard drive in my 10.04 machine and have divided it into two newly-formatted partitions. When I ls /dev, the drive shows as sdb, sdb1 and sdb2. Dolphin sees both partitions, but I cannot write to either of them. The owner is root, but root is the owner of my other drives as well, and I can write to them. I have tried sudo chmod 777, and when I ls -l /dev/sdb*, it shows full read, write and execute permissions. When I go into Dolphin, it asks me for my password to get access to the device, but putting in the password doesn't seem to help.

    I've been poking around looking for an answer but have not been successful. I gather, though, that a print-out of fstab is helpful, so here it is:

    # /etc/fstab: static file system information.
    #
    # Use 'blkid -o value -s UUID' to print the universally unique identifier
    # for a device; this may be used with UUID= as a more robust way to name
    # devices that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc nodev,noexec,nosuid 0 0
    # / was on /dev/sda1 during installation
    UUID=36bf5fae-4205-4c97-a867-77db799456f6 / ext4 errors=remount-ro 0 1
    /dev/sda5 /home ext4 defaults 0 2
    # swap was on /dev/sda6 during installation
    UUID=53ce5dcb-42d8-470c-828e-3e53a647437c none swap sw 0 0

    Here is the output of /etc/mtab:

    /dev/sda1 / ext4 rw,errors=remount-ro 0 0
    proc /proc proc rw,noexec,nosuid,nodev 0 0
    none /sys sysfs rw,noexec,nosuid,nodev 0 0
    none /sys/fs/fuse/connections fusectl rw 0 0
    none /sys/kernel/debug debugfs rw 0 0
    none /sys/kernel/security securityfs rw 0 0
    none /dev devtmpfs rw,mode=0755 0 0
    none /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
    none /dev/shm tmpfs rw,nosuid,nodev 0 0
    none /var/run tmpfs rw,nosuid,mode=0755 0 0
    none /var/lock tmpfs rw,noexec,nosuid,nodev 0 0
    none /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
    /dev/sda5 /home ext4 rw 0 0
    vmware-vmblock /var/run/vmblock-fuse fuse.vmware-vmblock rw,nosuid,nodev,default_permissions,allow_other 0 0
    /dev/sdb1 /media/Backup_1 ext4 rw,nosuid,nodev,uhelper=hal 0 0
    /dev/sdd1 /media/Data\0401 fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0
    /dev/sdd5 /media/Data\0402 fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0

    I have tried mounting the new device, and I get the message that sdb* is not in fstab or mtab. So I think my question is how to modify those files so that I can mount and use the new partitions. I could, of course, be totally wrong; that happens a lot.
    Last edited by Don; Mar 02, 2012, 07:59 PM.

    #2
    Firstly,
    Originally posted by Don View Post
    I have tried sudo chmod 777, and when I ls -l /dev/sdb*, it shows full read, write and execute permissions.
    URAGG, Don't do that... it means anyone can write raw to the device unrestricted... it doesn't help with mounting AT ALL and is a huge security hole...

    Sorry, if that was a bit harsh :S.

    Ok, now that's out the way,


    Originally posted by Don View Post
    I've been poking around looking for an answer but have not been successful. I gather, though, that a print-out of fstab is helpful, so here it is:
    This wont help, its written when you first install kubuntu and isn't touched since (unless you modify it, or by some select programs such as ntfs-conf).

    This is the file to edit if you want the drives mounted at boot but you have to add them manually.

    Originally posted by Don View Post
    /dev/sdb1 /media/Backup_1 ext4 rw,nosuid,nodev,uhelper=hal 0 0
    Note that ext4 knows about unix permissions so you have to chmod/own this folder in order to access it be the relevant users.

    Originally posted by Don View Post
    I have tried mounting the new device, and I get the message that sdb* is not in fstab or mtab.
    How are you tring to mount them? It sounds like you are trying "sudo mount /dev/sdb1" ... which will only mount it if there is an entry in /etc/fstab (or mtab which lists currently mounted partitions). Use "sudo mount <device file> <mount point>" (ie sudo mount /dev/sdb1 /mnt to mount sdb1 to /mnt) to mount devices that arnt in /etc/fstab (or if you want to mount them to a different location).

    I would recommend you add an entry to /etc/fstab for each of the devices (since they are internal they can just be mounted at boot). To do this, first pick where you want them mounted (make sure its an empty folder, create it if it doesn't exist). Then add a line in fstab with the following template:
    <device> <mount point> <filesystem type> <mount options> X 0
    where:
    device - is the device you want to mount (/dev/sdb1 for example)
    mount point - is where you want it mounted
    filesystem type - is the filesystem the partition contains (such as ext4)
    mount options - are that options you want to mount it with ("default" should be enough)
    X - is if you want it check on start up or not, 0 for no, 2 otherwise.
    0 - this should generally be 0 unless you know what your doing

    (note, fields are white space separated, so the cannot contain spaces in them)

    it should look something like:
    /dev/sdb1 /media/MOUNTHERE ext4 defaults,noatime 0 0

    (noatime is a useful for increasing performance as it doesn't cause a write to update the access time every time a file is read).

    Sorry for the haphazard post, if you need me to explain anything again just ask

    If you give alittle bit more info such as how do you want these drives to be accessed? mounted at boot? or by the user? where you want them mounted? what are they for? I could give better suggestions/advice.

    Comment


      #3
      Good heavens! Thanks for responding so quickly and thoroughly. I'm going to try to put into effect what you have suggested, and I'll get back to you. Basically I want to use the new drive simply to back up data from both my home and office computers.
      I will undo the permission changes I made. The computer is in my home, so I'm the only one with access, but I take your security advice quite seriously. Don't worry about being harsh; subtlety is wasted on me. Hitting me in the face with a 2-by-4 gets my attention. Then you can talk to me.

      Comment


        #4
        Originally posted by Don View Post
        Basically I want to use the new drive simply to back up data from both my home and office computers....The computer is in my home.
        The only good backup system is to have it backed up remotely, I would recommend (if you can) to backup your home to your work and your work to your home... If not then I would invest in a external hdd to back up your home (and take it to work). That if your home or office burn down (worst case) then you don't lose everything.

        Its also a good idea to create versioned backups so you can recover a deleted file even after you have re-backed up. (rdiff-backup is a good tool for this).

        Comment


          #5
          I finally got time to get back to this. I have changed fstab as you suggested, with the result that Kubuntu no longer asks me for a password when I go into these partitions using Dolphin. I still cannot write to them, however; the "Paste One File" option is greyed out. I don't know how to "activate" that; if I could, everything would be set. How should I proceed?
          In answer to your other questions, I do back up remotely, but also locally. I have external HDs in both places, but it's also convenient to have a local internal backup. I've always used versioned backups so that I can go back to prior versions of manuscripts to "undo" edits that haven't worked out.
          (Just in case you couldn't tell), I'm still a newbie to Linux. I've looked at the permissions on my other drives. All are owned by root, and all are 660. Is that what I should be setting for the two new partitions?
          I appreciate all the time you're spending on my behalf. Thank you.

          Oops. Replying to my own question with a bit more research: I changed the ownership of Backup_1 to my username, and now I can access it. I think that confirms that I should change the drive permissions to 660. Am I on the right track, or have I gone around the bend again?
          Last edited by Snowhog; Feb 05, 2012, 10:02 AM. Reason: Edit your same day posts rather than reply to them.

          Comment


            #6
            Originally posted by Don View Post
            I finally got time to get back to this. I have changed fstab as you suggested, with the result that Kubuntu no longer asks me for a password when I go into these partitions using Dolphin.
            This is because dolphin is not longer mounting the filesystems when you try to access them, but is now being done during boot (by root).

            I still cannot write to them, however; the "Paste One File" option is greyed out. I don't know how to "activate" that; if I could, everything would be set.
            It will be greyed out when you cannot paste files (ie you don't have write permissions).

            In answer to your other questions, I do back up remotely, but also locally. I have external HDs in both places, but it's also convenient to have a local internal backup. I've always used versioned backups so that I can go back to prior versions of manuscripts to "undo" edits that haven't worked out.
            (Just in case you couldn't tell),
            Good to know others are doing proper backups as well

            [QUOTE]I'm still a newbie to Linux. I've looked at the permissions on my other drives. All are owned by root, and all are 660. Is that what I should be setting for the two new partitions?
            I appreciate all the time you're spending on my behalf. Thank you.

            Oops. Replying to my own question with a bit more research: I changed the ownership of Backup_1 to my username, and now I can access it. I think that confirms that I should change the drive permissions to 660. Am I on the right track, or have I gone around the bend again?
            What do you mean by the drive permissions? You should NOT edit the permissions of the device files (ie /dev/sd*)... It should be enough to change the permissions of the mount points to be able to access them.

            You can set what ever permissions you want/require on the mount points and the best option depends on what you want to do with it.

            All files/folders in linux have both an owner and group associated with them and can have different permissions for the owner group and everyone else. The permissions are represented in the three numbers you have (660) what this means is the owner has read and write permissions (6), the group has read and write permissions (6) and everyone else has no permissions (0).

            The actual permissions are the sum of the individual permissions:
            1 execute
            2 write
            4 read
            (so read+write is 6)

            Note: to be able to read directories they need to be executable :S

            Comment

            Working...
            X