LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Please Help me with Partitions!! (https://www.linuxquestions.org/questions/linux-newbie-8/please-help-me-with-partitions-4175597196/)

naumanafsar 01-10-2017 11:10 PM

Please Help me with Partitions!!
 
Hey guys i just installed Linux Mint 18 for the first time, and i am having a problem with partitions,
during installation i made 4 partitions
1 /
2 /home
3 /swap area
4 /datapartition
the problem i am facing i with data partition is that i can't use it!
i can't move/copy any data to that folder while the whole partition is empty!
please help me here.
Thank You!

agillator 01-10-2017 11:15 PM

First, is the data partition mounted? Second, what are the permissions for the mount point? Does the user trying to use that directory have the necessary permissions?

Jjanel 01-11-2017 12:32 AM

Hi naumanafsar! I just wanted to say 'Welcome'. And encouragement on 'digging thru' whatever 'puzzles' Linux presents;) Are you familiar with 'the terminal'/CLI? One way I approach things it to try to provide a way for others to visualize and even reproduce my problem situation. Also I try to compose optimal web-search keywords, to demonstrate the issue. **Are there any error messages?** Do you have a way to copy and paste info here (delimited with [CODE]...[/CODE] tags)? Like:
Code:

df /datapartition; ls -ld /datapartition
lsblk -fp
tail /etc/fstab

(plus especially ways to check what agillator asked)

Best Wishes! Looking forward to hearing back from you. ENJOY your Linux 'journey'!

aragorn2101 01-11-2017 03:17 AM

Hi, Welcome to LQ,

During installation, did you tell Mint where your "home" partition is to be mounted?

For the "data" partition, it is probably best if you just used the file manager/browser to mount it and get access to it. Now if the partition already has a filesystem on it, e.g. ext4, then only root has permission to write to that partition. Then, you have to log in as root in a terminal and create a directory there, then change the ownership of the directory so that you get permission to read and write to that particular directory. Then you can put all your files inside that directory.

Do you have any notion of the command line?

Check these out in the meantime:
http://www.tldp.org/LDP/GNU-Linux-To...html/x9543.htm
http://www.tldp.org/HOWTO/Hard-Disk-Upgrade/mount.html

hydrurga 01-11-2017 03:55 AM

Here's the thing. By default /data is a directory located in a system area of Linux. As such, Mint will have set up the filesystem on the related partition as owned and modifiable by the root user, not you as an ordinary user. That is why you cannot change anything in it without some modifications.

In Mint, I find it's best to mount data partitions to /media, and to do this automatically through the /etc/fstab file.

But first things first. We need to find out which device contains the data partition in question, mount it in /media, and take ownership of it.

Can you please post the output from the following commands, which will enable us to get info on the data partition:

sudo parted -l

ls -l /dev/disk/by-label

Jjanel 01-11-2017 04:46 AM

>"By default /data is a directory located in a system area of Linux."
Oh, you mean: a newly-made /data would be in 'the root' ..., like:
mkdir /MYwhatever; df /MYwhatever shows it 'in' / == 'root' filesystem! (until `mount` of a fs on it)
I was about ready to RUN back to my 1990's SunOS4.x, when `df /data` failed on my new Mint18.1 ;)
/dev/disk/by-label wasn't there: only: by-id by-path by-uuid. Try: ls -l /dev/disk/*
(tho it may NOT give any 'useful' info here :( Try: lsblk -fp ;) )

agillator 01-11-2017 06:54 AM

A path to anything in Linux starts with the root directory (/). Everything in Linux is a file. When you create a partition you are setting aside an area of the disk and creating a file system on it. It is unreachable until you 'mount' it somewhere. Most partitions can be mounted almost anywhere. Most partitions, when created during installation, are owned by the root user. Most partitions can only be mounted by the root user without using special options. So, if you have a partition mounted at /data (a directory directly below the root directory) it is probably owned by the root user until and unless you change the ownership with the chown command and/or change permissions with the chmod command. At this point you need to learn about the Linux permission system (just google linux permissions) and read the manual pages for chown and chmod ('man chown' and 'man chmod'). It is really important that you understand these before you go much further as it has a lot to do with the security of your system. Without knowing this you can screw things up royally.

naumanafsar 01-11-2017 07:10 AM

Yes /datapartition is mounted and root owns all the permissions
i tried chmod command but this is the result
Quote:

chown: changing ownership of '/datapartition': Operation not permitted

naumanafsar 01-11-2017 07:17 AM

ls -l /dev/disk/by-label is not working on my Linux 18 so i tried ls -l /dev/disk/* and here's the output
Code:

/dev/disk/by-id:
total 0
lrwxrwxrwx 1 root root  9 Jan 11 17:54 ata-PIONEER_DVD-RW_DVRTD11RS_SLC1110848 -> ../../sr0
lrwxrwxrwx 1 root root  9 Jan 11 18:12 ata-ST9160412AS_5VG26R17 -> ../../sda
lrwxrwxrwx 1 root root 10 Jan 11 18:12 ata-ST9160412AS_5VG26R17-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jan 11 18:12 ata-ST9160412AS_5VG26R17-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jan 11 18:12 ata-ST9160412AS_5VG26R17-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Jan 11 18:12 ata-ST9160412AS_5VG26R17-part6 -> ../../sda6
lrwxrwxrwx 1 root root 10 Jan 11 18:12 ata-ST9160412AS_5VG26R17-part7 -> ../../sda7
lrwxrwxrwx 1 root root  9 Jan 11 18:12 wwn-0x5000c5001e65e017 -> ../../sda
lrwxrwxrwx 1 root root 10 Jan 11 18:12 wwn-0x5000c5001e65e017-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jan 11 18:12 wwn-0x5000c5001e65e017-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jan 11 18:12 wwn-0x5000c5001e65e017-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Jan 11 18:12 wwn-0x5000c5001e65e017-part6 -> ../../sda6
lrwxrwxrwx 1 root root 10 Jan 11 18:12 wwn-0x5000c5001e65e017-part7 -> ../../sda7

/dev/disk/by-path:
total 0
lrwxrwxrwx 1 root root  9 Jan 11 18:12 pci-0000:00:1f.2-ata-1 -> ../../sda
lrwxrwxrwx 1 root root 10 Jan 11 18:12 pci-0000:00:1f.2-ata-1-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jan 11 18:12 pci-0000:00:1f.2-ata-1-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jan 11 18:12 pci-0000:00:1f.2-ata-1-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Jan 11 18:12 pci-0000:00:1f.2-ata-1-part6 -> ../../sda6
lrwxrwxrwx 1 root root 10 Jan 11 18:12 pci-0000:00:1f.2-ata-1-part7 -> ../../sda7
lrwxrwxrwx 1 root root  9 Jan 11 17:54 pci-0000:00:1f.2-ata-3 -> ../../sr0

/dev/disk/by-uuid:
total 0
lrwxrwxrwx 1 root root 10 Jan 11 18:12 257cf225-3410-46ba-be57-c1466dce69d9 -> ../../sda5
lrwxrwxrwx 1 root root 10 Jan 11 18:12 87724ad3-7a49-4b8e-a742-cf846d1d6417 -> ../../sda7
lrwxrwxrwx 1 root root 10 Jan 11 18:12 8a47ff16-e1e4-4baf-9e3d-3519e085d3bc -> ../../sda1
lrwxrwxrwx 1 root root 10 Jan 11 18:12 a33e85d7-8aeb-43ff-8b2b-384de4970eb7 -> ../../sda6


Jjanel 01-11-2017 07:25 AM

Repeating my #3?:
Code:

df /datapartition; ls -ld /datapartition
lsblk -fp
tail /etc/fstab

grep /datapartition /etc/mtab
lsattr /datapartition

Did you `sudo` the chown? What exact chown command did you enter? [chmod?]
Which of sda5,6,7 is your /datapartition? (is that it's exact name?)

#7 is a good 'warning';)

hydrurga 01-11-2017 07:29 AM

That's strange, because /dev/disk/by-label works fine on my Mint 18.1 installation. It's an easy way to get at the filesystem labels. Unless of course none of your filesystems actually have labels. The only reason I asked for that was so that we could quickly make sure which was your data partition, but there are other ways of doing that.

How about the output from sudo parted -l? That will give us a list of all your partitions in a nice handy format complete with filesystem types and partition sizes.

hydrurga 01-11-2017 07:35 AM

In order to avoid confusion, naumanafsar, I'll leave you in the hands of Jjanel. After all, he was here first. Let us know if he is unable to resolve your issue.

Jjanel 01-11-2017 07:37 AM

parted -l is not useful here, because it doesn't provide any *mount* info.

no;) it's time for me to sleep, and hydrurga knows way more Linux than I do (I only know old Unix:()

p.s. I added two more commands to my #10 ...

BW-userx 01-11-2017 08:03 AM

what is going on here?
4 partitions: only 3 mounted? your fstab should be simple 1 hard drive 4 partitions: in lue of UUID which can be used to replace this simple set up.
Code:

#root
/dev/sda1 / ext4 defaults 0 1
#home
/dev/sda2 /home ext4 defaults 0 2
#swap
/dev/sda3 none swap sw 0 0
#data
/dev/sda4 /media/storage ext4 defaults 0 3


your fstab should look something similar to that if MINT is using UUID same set up. UUID replaces /dev/sdxx
a mixing of the two device and UUID example (my fstab)
Code:

UUID=a2af02da-4b76-467a-b63b-0b0ec296ca0d / ext4 defaults 0 1
UUID=2fadc5d7-8421-436d-a842-a543cbe20a4f /home ext4 defaults 0 2

/dev/sdb3 /home/userx/Downloads ntfs-3g defaults 0 0
#SD CARD SWAP PARTITION
UUID=9799b83a-f733-4f65-b4e0-e8e8f419fc20 none swap sw 0 0

blkid to get your UUID
create a directory on the system side to mount your data to. Done in root or user with root permissions of course.
Code:

#chmod 755 /media/data -R
 or
#chown userName:userName /media/data -R

replace path with your actual path to whatever YOU decided to call your directories.

Jjanel 01-11-2017 08:07 AM

BW! My HERO! Good AM! by the way, are you ever going to read my Blog4u/PM/email? :D May I sleep now?


All times are GMT -5. The time now is 03:34 AM.