Ubuntu: How to provide user permission to read, write on `/dev/sdax`? What is the syntax?



Question:

I have two my hard disk divided into two partition (apart from swap). First one is /dev/sda3 on which I have my ubuntu installation. Second one is /dev/sda1. Now, when I try to copy a file to /dev/sda1, I need to do a sudo, because my user does not have permission.

How do I give read, write permission to my user? I know chmod 777 is a bad idea. How about chown or chgrp?

by the way, /dev/sda1 is mounted as /media/hood, so what should be the syntax my command?

I have two my hard disk divided into two partition (apart from swap). First one is /dev/sda3 on which I have my ubuntu installation. Second one is /dev/sda1. Now, when I try to copy a file to /dev/sda1, I need to do a sudo, because my user does not have permission.

How do I give read, write permission to my user? I know chmod 777 is a bad idea. How about chown or chgrp?

The output of mount command is as as follows:

/dev/sda3 on / type ext4 (rw,errors=remount-ro)  proc on /proc type proc (rw,noexec,nosuid,nodev)  sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)  none on /sys/fs/fuse/connections type fusectl (rw)  none on /sys/kernel/debug type debugfs (rw)  none on /sys/kernel/security type securityfs (rw)  udev on /dev type devtmpfs (rw,mode=0755)  devpts on /dev/pts type devp  ts (rw,noexec,nosuid,gid=5,mode=0620)  tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)  none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)  none on /run/shm type tmpfs (rw,nosuid,nodev)  gvfs-fuse-daemon on /home/chirag/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=chirag)  

/dev/sda1 on /media/hood type ext4 (rw,nosuid,nodev,uhelper=udisks)


Solution:1

Changing the ownership allowed me to copy without doing sudo. command used:

sudo chown chirag:chirag /media/hood/ -R  

Where, chirag:chirag is user:group.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »