Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using Ubuntu 12.04. During installation I give only a single partition. After that I created two more partitions using gparted, but the new partitions are totally useless that I cannot create a new folder or any other tasks like that.

I tried to edit the permissions, but its showing message like only a root user can do it.So feeling exhausted I reverted it back to single partition again.Can someone me with this. I need to create two useful partitions.

share|improve this question
    
Are they are ext4 partitions? –  Avinash Raj Mar 13 at 11:21
    
@AvinashRaj yes ext4 –  user257733 Mar 13 at 11:25
    
What's the output of mount and cat /etc/fstab? –  Braiam Mar 13 at 16:25

2 Answers 2

Don't try to change the ownership of your single ext4 partition.From the single partition again create two new ext4 partitions, like you did before.Then mount the newly created ext4 partitions.After that, change the ownership of the mounted partitions(which are newly created) from root to $USER.

Try the below commad to change the ownership of the mounted partition from root to $USER,

sudo chown $USER:$USER /media/xxxx

/media/xxxx - Represents the location where your ext4 partition is mounted.

By default for a newly created ext4 partition, owner must be root.You have to change it to $USER, so that you can access the mounted partition in read write mode.

share|improve this answer

To have partitions mounted in read/write mode, you need to change the mount options in /etc/fstab and make sure your user has read/write access to the place where the partitions are mounted (the mount point).

  1. Get the UUID of your partitions by running blkid in a terminal. The output will look something like this (this is on my system, your details will be different):

    /dev/sda1: SEC_TYPE="msdos" LABEL="DellUtility" UUID="3030-3030" TYPE="vfat" 
    /dev/sda2: LABEL="RECOVERY" UUID="E208CFC008CF9249" TYPE="ntfs" 
    /dev/sda3: LABEL="OS" UUID="C0BCD19CBCD18D72" TYPE="ntfs" 
    /dev/sda5: LABEL="READER" UUID="4C2D-395C" TYPE="vfat" 
    /dev/sda8: UUID="7696fff5-139c-425f-b3c1-5a3e2ba1158d" TYPE="swap" 
    /dev/sda6: LABEL="Home" UUID="a180cec0-ecad-4944-8e29-7c9249ed23b0" TYPE="ext4" 
    /dev/sda7: UUID="d5cf136f-f344-4187-92c5-e29c6006c5c6" TYPE="ext4" 
    

    Note the UUID of your partition (eg. a180cec0-ecad-4944-8e29-7c9249ed23b0 and it's type, eg. ext4), you will need these to modify fstab.

  2. Create the mount point for these partitions, the place where you want them to be accessible. For example, /media/data1 and /media/data2, and change their permissions to give everyone read/write access to your user:

    sudo mkdir /media/data1 /media/data2
    sudo chmod a+wrx  /media/data1 /media/data2
    
  3. Let's say you want sda6 and sda7 to be mounted read/write. Open /etc/fstab as root:

    sudo gedit /etc/fstab
    
  4. Add these lines to the file:

    ## sda6
    UUID=a180cec0-ecad-4944-8e29-7c9249ed23b0   /media/data1    ext4    defaults    0   0
    ## sda7
    UUID=d5cf136f-f344-4187-92c5-e29c6006c5c6   /media/data2    ext4    defaults    0   0
    

    IMPORTANT: make sure you change the UUID above to the one returned by blkid and the ext4 to whatever TYPE was for that partition.

  5. Either reboot (they will now be mounted automatically) or run sudo mount -a. You should now have read write access to both partitions at /media/data1 and /media/data2.

share|improve this answer
    
Too complicated... –  Dusan Milosevic Mar 13 at 20:12
2  
@DušanMilosevic perhaps but 1) it actually works 2) it won't break your system 3) it will persist after reboot 4) is the right way® to do it. –  terdon Mar 13 at 22:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.