LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-10-2017, 11:10 PM   #1
naumanafsar
LQ Newbie
 
Registered: Jan 2017
Posts: 6

Rep: Reputation: Disabled
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!
 
Old 01-10-2017, 11:15 PM   #2
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 419

Rep: Reputation: Disabled
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?
 
Old 01-11-2017, 12:32 AM   #3
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
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'!

Last edited by Jjanel; 01-11-2017 at 01:08 AM.
 
Old 01-11-2017, 03:17 AM   #4
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 553

Rep: Reputation: 277Reputation: 277Reputation: 277
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

Last edited by aragorn2101; 01-11-2017 at 03:19 AM.
 
1 members found this post helpful.
Old 01-11-2017, 03:55 AM   #5
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918
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
 
Old 01-11-2017, 04:46 AM   #6
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
>"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 )

Last edited by Jjanel; 01-11-2017 at 07:32 AM.
 
Old 01-11-2017, 06:54 AM   #7
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 419

Rep: Reputation: Disabled
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.
 
4 members found this post helpful.
Old 01-11-2017, 07:10 AM   #8
naumanafsar
LQ Newbie
 
Registered: Jan 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
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
 
Old 01-11-2017, 07:17 AM   #9
naumanafsar
LQ Newbie
 
Registered: Jan 2017
Posts: 6

Original Poster
Rep: Reputation: Disabled
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
 
Old 01-11-2017, 07:25 AM   #10
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
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'

Last edited by Jjanel; 01-11-2017 at 08:02 AM.
 
Old 01-11-2017, 07:29 AM   #11
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918
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.
 
Old 01-11-2017, 07:35 AM   #12
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918Reputation: 2918
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.
 
Old 01-11-2017, 07:37 AM   #13
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
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 ...

Last edited by Jjanel; 01-11-2017 at 07:56 AM.
 
Old 01-11-2017, 08:03 AM   #14
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
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.

Last edited by BW-userx; 01-11-2017 at 08:08 AM.
 
2 members found this post helpful.
Old 01-11-2017, 08:07 AM   #15
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

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


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
[SOLVED] what is a logical partitions and group partitions and how to check disk space on a partition ITareliteralyMyInitials Linux - Newbie 10 02-08-2016 11:19 AM
rebuild partitions/label from existing partitions - used parted on wrong drive zedmelon Linux - Software 4 07-26-2013 03:42 PM
[SOLVED] Is it safe to resize my Slackware partitions after removing my Mint 10 partitions? Robert.Thompson Slackware 19 02-18-2011 11:47 AM
Change primary partitions to logical partitions AND migrate their data? chickenlinux Linux - Hardware 10 04-04-2010 04:31 PM
how do I add partitions to drives that have Logical Volume (LVM) partitions? The MJ Linux - Software 5 08-17-2006 06:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:47 PM.

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
Open Source Consulting | Domain Registration