LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2015, 04:12 PM   #1
zyanni
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Rep: Reputation: Disabled
Unhappy changing partition permissions


How can I make this Data partition be readable and writeable? I tried the "chmod 777" command, but was unsure of what directory to type in . I tried several but the command wouldn't start. This partition is on the second hardrive. I am just trying to get more storage on the second hard drive, so I hope I partitioned correctly. The drive was originally mounted as usr, but I managed to shrink that and make a new partition named Data.
 
Old 02-26-2015, 04:44 PM   #2
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 937

Rep: Reputation: 174Reputation: 174
Partitions do not have ownerships or permissions, as they are just bits of disk.

Mount points (directories) do have ownerships/permissions - it is highly likely that
your data directory is owned by root and/or has no write access - especially if it is mounted as /data.

To see all relevant info, use a command entry screen and enter
Code:
df -h
 
Old 02-26-2015, 05:05 PM   #3
zyanni
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
Ok , here is what I got when I put that command in:

randy@randy-HP-Pavilion-dv9000-RG335UA-ABA ~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 22G 1.8G 20G 9% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 986M 4.0K 986M 1% /dev
tmpfs 201M 1.4M 199M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1001M 76K 1001M 1% /run/shm
none 100M 40K 100M 1% /run/user
/dev/sda3 85G 432M 80G 1% /home
/dev/sda1 3.7G 74M 3.4G 3% /boot
/dev/sdb1 6.3G 4.6G 1.4G 78% /usr


Does this help at all?
 
Old 02-26-2015, 07:13 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,869

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
The drive was originally mounted as usr, but I managed to shrink that and make a new partition named Data.
The output in your last post show sdb1 mounted at /usr and that is the only mount point on a second drive. If you have a second partition on that drive it won't show with df -h if it is not mounted. Did you create a data mount point? Where? Did you try to mount it? With what command.
 
Old 02-26-2015, 07:27 PM   #5
zyanni
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
ok, here it is with the drive mounted...

randy@randy-HP-Pavilion-dv9000-RG335UA-ABA ~ $ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 22G 1.8G 20G 9% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 986M 4.0K 986M 1% /dev
tmpfs 201M 1.4M 199M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1001M 76K 1001M 1% /run/shm
none 100M 40K 100M 1% /run/user
/dev/sda3 85G 432M 80G 1% /home
/dev/sda1 3.7G 74M 3.4G 3% /boot
/dev/sdb1 6.3G 4.6G 1.4G 78% /usr
/dev/sdb2 104G 60M 99G 1% /media/randy/Data

Tried to copy a test document to it when mounted but still would not work...here is some more info:

/dev/sda2 / ext4 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
none /sys/fs/cgroup tmpfs rw 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
udev /dev devtmpfs rw,mode=0755 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0
none /run/lock tmpfs rw,noexec,nosuid,nodev,size=5242880 0 0
none /run/shm tmpfs rw,nosuid,nodev 0 0
none /run/user tmpfs rw,noexec,nosuid,nodev,size=104857600,mode=0755 0 0
none /sys/fs/pstore pstore rw 0 0
/dev/sda3 /home ext4 rw 0 0
/dev/sda1 /boot ext4 rw 0 0
/dev/sdb1 /usr ext4 rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
systemd /sys/fs/cgroup/systemd cgroup rw,noexec,nosuid,nodev,none,name=systemd 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,user=randy 0 0


also this:

rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,relatime,size=1008844k,nr_inodes=252211,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=204840k,mode=755 0 0
/dev/disk/by-uuid/92d15c39-dd88-4872-bac6-2a7706b654b1 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
none /sys/fs/cgroup tmpfs rw,relatime,size=4k,mode=755 0 0
none /sys/fs/fuse/connections fusectl rw,relatime 0 0
none /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/kernel/security securityfs rw,relatime 0 0
none /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
none /run/shm tmpfs rw,nosuid,nodev,relatime 0 0
none /run/user tmpfs rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755 0 0
none /sys/fs/pstore pstore rw,relatime 0 0
/dev/sda3 /home ext4 rw,relatime,data=ordered 0 0
/dev/sda1 /boot ext4 rw,relatime,data=ordered 0 0
/dev/sdb1 /usr ext4 rw,relatime,data=ordered 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
systemd /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,name=systemd 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0


Does that help describe the situation?
 
Old 02-26-2015, 07:28 PM   #6
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 937

Rep: Reputation: 174Reputation: 174
Your data partition isn't mounted.

The use of separate / and /usr partitions, whilst perfectly workable is rather unusual.
It's more usual to just treat /usr as a sub-directory of /

I'm guessing that your data partition is /dev/sdb2 - assuming that this is true...
If it was me...I would do
Code:
sudo mkdir /data
- this will put your data mount-point in /.
Then add an extra line in /etc/fstab which is similar to the /dev/sdb1 line, but changing sdb1 to sdb2 & changing /usr to /data
Code:
sudo text_editor_of_your_choice /etc/fstab
Then reboot.
 
Old 02-27-2015, 10:04 AM   #7
zyanni
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
OK, I think I'm beginning to understand. This is the first time installing on a laptop with two hard drives. I have done four other installs but with only one drive. I thought I could have two home partitions, and when it wouldn't let me choose a second /home on the second drive I chose /usr. Now I know that was wrong.
Before I go any further here is the etc/mtab and proc/mounts info updated with the drive mounted if it makes any difference in which way I go with this.

/dev/sda2 / ext4 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
none /sys/fs/cgroup tmpfs rw 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
udev /dev devtmpfs rw,mode=0755 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0
none /run/lock tmpfs rw,noexec,nosuid,nodev,size=5242880 0 0
none /run/shm tmpfs rw,nosuid,nodev 0 0
none /run/user tmpfs rw,noexec,nosuid,nodev,size=104857600,mode=0755 0 0
none /sys/fs/pstore pstore rw 0 0
/dev/sdb1 /usr ext4 rw 0 0
/dev/sda1 /boot ext4 rw 0 0
/dev/sda3 /home ext4 rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
systemd /sys/fs/cgroup/systemd cgroup rw,noexec,nosuid,nodev,none,name=systemd 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,user=randy 0 0
/dev/sdc1 /media/randy/306A-2060 vfat rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2 0 0
/dev/sdb2 /media/randy/Data ext4 rw,nosuid,nodev,uhelper=udisks2 0 0


and this
rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,relatime,size=1008844k,nr_inodes=252211,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=204840k,mode=755 0 0
/dev/disk/by-uuid/92d15c39-dd88-4872-bac6-2a7706b654b1 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
none /sys/fs/cgroup tmpfs rw,relatime,size=4k,mode=755 0 0
none /sys/fs/fuse/connections fusectl rw,relatime 0 0
none /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/kernel/security securityfs rw,relatime 0 0
none /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
none /run/shm tmpfs rw,nosuid,nodev,relatime 0 0
none /run/user tmpfs rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755 0 0
none /sys/fs/pstore pstore rw,relatime 0 0
/dev/sdb1 /usr ext4 rw,relatime,data=ordered 0 0
/dev/sda1 /boot ext4 rw,relatime,data=ordered 0 0
/dev/sda3 /home ext4 rw,relatime,data=ordered 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
systemd /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,name=systemd 0 0
gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0
/dev/sdc1 /media/randy/306A-2060 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0
/dev/sdb2 /media/randy/Data ext4 rw,nosuid,nodev,relatime,data=ordered 0 0

JeremyBoden, I think I am starting to head in the right direction. I understand the first command, but not sure what you mean by adding in the extra line.
By doing the fix method will I still have access to storage on the first drive or will the /home be only on the second drive? It would seem like a waste of two 120 gig drives to only be able to write to one drive. Thanks for your help and patience!
 
Old 02-27-2015, 11:19 AM   #8
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 937

Rep: Reputation: 174Reputation: 174
You should have just one line for /dev/sdb2 in /etc/fstab that reads
Code:
/dev/sdb2 /media/randy/Data  ext4  rw,errors=remount-ro	0 2
The other parameters such as nosuid etc are a bit esoteric and not needed.

You can access data stored in /home/randy (1st disk) and also data in /media/randy/Data (2nd disk), simultaneously.
You can't have more than one partition mounted as /home at the same time - this would cause Linux to get confused!

Work for the future...
When you get it working, I would create some meaningful sub-directories in /media/randy/Data and read up about symbolic links.
 
Old 02-27-2015, 01:37 PM   #9
zyanni
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
JeremyBoden,
Still not sure exactly what to do. I think I understand the concept but not the execution of it.
So far I will:

#1----open terminal and type in "sudo mkdir /data" and let that run...



#2----then while still in the terminal type in "sudo text_editor_of_your_choice /etc/fstab"
(Do I type that in exactly? meaning the "text_editor_of_your_choice" part?) or (I use the program "Text Editor")and let that run...

I can then open the file, "/etc/fstab" and there should only be this one line..."/dev/sdb2 /media/randy/Data ext4 rw,errors=remount-ro 0 2"..... in it?

Is it just those two commands? Then I can access the second drive?
Sorry for the dumb questions....
 
Old 02-27-2015, 02:52 PM   #10
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 937

Rep: Reputation: 174Reputation: 174
Since you have chosen a mount-point of /media/randy/Data,
there is a slight amendment to #1:-
If you don't already have a directory called /media/randy/Data you need to create it
Code:
sudo mkdir /media/randy/Data
For #2, in addition to the current lines in /etc/fstab you need a line for /dev/sdb2
It should read
Code:
/dev/sdb2 /media/randy/Data  ext4  rw,errors=remount-ro  0 2
You can edit your /etc/fstab file with any text editor:-
Code:
sudo text_editor_of_your_choice /etc/fstab
I suggest that for "text_editor_of_your_choice" you use a program such as nano or gedit or whatever you are most familiar with.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permissions changing, System Changing swgeek Linux - Desktop 2 09-24-2011 12:37 PM
Problems changing permissions for Linux partition blueobsession Linux - Software 3 05-18-2007 10:52 PM
problem changing file permissions on fat32 partition coolamit78 Linux - Software 4 01-18-2004 02:44 PM
Problem changing permissions on partition habitue Linux - Newbie 2 10-23-2003 09:56 AM
Changing permissions on my windows partition jspaceman Slackware 5 10-01-2003 07:18 AM


All times are GMT -5. The time now is 01:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration