LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 10-30-2015, 12:19 AM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Rep: Reputation: 45
Mounting Separate partition.


hi,
I am using CentOS 6.5 in a non production environment. During installation I keep free space 5 GB.After installation i open terminal and format that partition,create a folder "common-share",
Restart the system.Now in desktop i can see my separate partition.I can see it in /etc/mtab file that it is mounted on "sda4".
The issue it I want to rename the name which is

Code:
/dev/sda4/  /media/211975bc-3d50-41fb-b88d-4a3ec85a0720
I want to mount it as in /etc/fstab

Code:
/dev/sda4   /common-share  ext4   defaults   0   0
Please guide me how can I fix the issue.Kindly see the attachments.

thanks
gardenair
Attached Thumbnails
Click image for larger version

Name:	common share.png
Views:	35
Size:	79.7 KB
ID:	19902   Click image for larger version

Name:	df.png
Views:	31
Size:	89.7 KB
ID:	19903   Click image for larger version

Name:	mtab.png
Views:	30
Size:	96.1 KB
ID:	19904   Click image for larger version

Name:	partition.jpg
Views:	30
Size:	64.8 KB
ID:	19905  
 
Old 10-30-2015, 03:07 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Your screenshots are a bit confusing. The sda4 line in fstab is commented out, therefore disabled; no wonder the partition is not mounted automatically. Also, you seem to have a directory named /verylongstringlookinglikeaUUID/common-share; why?

To achieve what you want:
  • Ensure /common-share exists
  • Remove the comment sign from the sda4 line in fstab.
    From then on, each time you reboot the system, sda4 will be mounted at /common-share.
  • umount /dev/sda4
  • mount -a

The latter just mounts everything in fstab.

Last edited by berndbausch; 10-30-2015 at 03:10 AM.
 
Old 10-30-2015, 06:46 AM   #3
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
I have even created a folder inside /dev/sda4 as "common-share" add it in /etc/fstab file.

Code:
/dev/sda4   /common-share  ext4   defaults   0   0
After rebooting I can not see my new partition by using mount command.

if i remove the entry from /etc/fstab then it appear in my desktop(after rebooting) .Just like you plug a USB stick/drive in the system it show the drive icon.

I do 'not know where i am doing wrong. One thing you can see in the 1st post snaps that the after giving comments (/etc/fstab) with

Code:
# /dev/sda4   /common-share  ext4   defaults   0   0

the partition is visble (after rebooting) . under /etc/mtab file it is visible.

where i am doing mistake not know...
 
Old 10-30-2015, 08:21 AM   #4
qlue
Member
 
Registered: Aug 2009
Location: Umzinto, South Africa
Distribution: Crunchbangified Debian 8 (Jessie)
Posts: 747
Blog Entries: 1

Rep: Reputation: 172Reputation: 172
Where, exactly, do you want the partition to be mounted? /common-share would be in the root directory.
You have to create this directory in the root directory with mkdir in order for the entry in fstab to work.
 
Old 10-30-2015, 09:07 AM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by gardenair View Post
I have even created a folder inside /dev/sda4 as "common-share" add it in /etc/fstab file.
You have to create it outside of /dev/sda4. Specifically:
Code:
mkdir /common-share
Quote:
After rebooting I can not see my new partition by using mount command.
My guess is that /common-share doesn't exist. In any case, you should see an error message while the system gets initialized, probably also in /var/log/messages.

Quote:
if i remove the entry from /etc/fstab then it appear in my desktop(after rebooting) .Just like you plug a USB stick/drive in the system it show the drive icon.
This is so because the desktop software detects an unmounted filesystem and mounts it automatically, just like it would with a USB stick, a CDROM or a network drive that becomes available.
 
Old 10-30-2015, 02:02 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by gardenair View Post
I have even created a folder inside /dev/sda4 as "common-share" add it in /etc/fstab file.

Code:
/dev/sda4   /common-share  ext4   defaults   0   0
That's not how it works.

The second column in fstab tells the system where you want to mount the device. Once the device is mounted, the mount location (/common-share in your example) will be the root of the drive, and all of the contents of the drive will be found inside of that directory. For that reason, the mount location needs to be created on your root filesystem BEFORE you can mount the drive there.

In your case, your fstab is trying to mount the drive in /common-share, AND you've also created a directory called common-share on the drive. So once you create /common-share and the system is actually able to mount the drive, the directory you created will be /common-share/common-share (and you'll also have /common-share/lost+found, and /common-share/whatever-else-you-have-on-your-drive).

Last edited by suicidaleggroll; 10-30-2015 at 02:06 PM.
 
Old 11-02-2015, 01:43 AM   #7
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
Thanks "suicidaleggroll" I have tried working according to your direction. In the /dev/sda4 i delete the folder"common-share" and add the line in

/etc/fstab file as

Code:
/dev/sda4   /common-share  ext4   defaults   0   0
After restart the system,open Gnome Under computer I can see only CD/DVD drive and Filesystem Icone.

At end I use comments with

Code:
# /dev/sda4   /common-share  ext4   defaults   0   0
Now it show me the separate partition (After restarting system). One thing more I want to add that I am doing all this in a non production environment. Iam using VMware Workstation .

One thing more how can I change the label name of the dive/sda4.

I am also attaching the screen short herewith.
Attached Thumbnails
Click image for larger version

Name:	desktop.jpg
Views:	23
Size:	57.8 KB
ID:	19933   Click image for larger version

Name:	fstab.png
Views:	23
Size:	89.7 KB
ID:	19934  

Last edited by gardenair; 11-02-2015 at 01:59 AM.
 
Old 11-02-2015, 07:58 AM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
And did you create /common-share???

Uncomment the line in fstab, run "umount /dev/sda4", run "mount -a", and post the output.

Last edited by suicidaleggroll; 11-02-2015 at 07:59 AM.
 
Old 11-02-2015, 11:42 PM   #9
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
In my previous past i not create the folder inside "/dev/sda4" i not give comments (# vi /etc/fstab ) for /dev/sda4 but not success.

well now I have created "common-share" folder in /dev/sda4 ,uncomment the line in fstab ,it show me the drive


The command which you have mentioned for output

Code:
# mount -a
you an see in the attachment and also with the said command with the attachment name "mount -a"
Attached Thumbnails
Click image for larger version

Name:	fstab.jpg
Views:	21
Size:	76.4 KB
ID:	19945   Click image for larger version

Name:	mount.jpg
Views:	23
Size:	79.3 KB
ID:	19946   Click image for larger version

Name:	mount-common-share.png
Views:	16
Size:	74.6 KB
ID:	19947   Click image for larger version

Name:	sda4.jpg
Views:	21
Size:	67.2 KB
ID:	19948   Click image for larger version

Name:	mount-a.png
Views:	20
Size:	68.9 KB
ID:	19949  


Last edited by gardenair; 11-02-2015 at 11:53 PM.
 
Old 11-03-2015, 08:50 AM   #10
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
:bangs head against wall:

1) Remove the directory common-share from your drive
2) Create the directory common-share in /, the root of your filesystem, currently mounted from sda2

As you can CLEARLY see from the screenshot you posted (please don't post screenshots when you can easily just copy/paste the text, it's a pain):
Quote:
# mount -a
mount: mount point /common-share does not exist
You need to make the directory before you can mount the drive there. This directory needs to be created in /, NOT IN SDA4.

PLEASE READ THE ABOVE POSTS ON THIS TOPIC, this was covered already, in detail, see below:

Quote:
Originally Posted by qlue View Post
Where, exactly, do you want the partition to be mounted? /common-share would be in the root directory.
You have to create this directory in the root directory with mkdir in order for the entry in fstab to work.
Quote:
Originally Posted by berndbausch View Post
You have to create it outside of /dev/sda4. Specifically:
Code:
mkdir /common-share

My guess is that /common-share doesn't exist. In any case, you should see an error message while the system gets initialized, probably also in /var/log/messages.
Quote:
Originally Posted by suicidaleggroll View Post
That's not how it works.

The second column in fstab tells the system where you want to mount the device. Once the device is mounted, the mount location (/common-share in your example) will be the root of the drive, and all of the contents of the drive will be found inside of that directory. For that reason, the mount location needs to be created on your root filesystem BEFORE you can mount the drive there.

In your case, your fstab is trying to mount the drive in /common-share, AND you've also created a directory called common-share on the drive. So once you create /common-share and the system is actually able to mount the drive, the directory you created will be /common-share/common-share (and you'll also have /common-share/lost+found, and /common-share/whatever-else-you-have-on-your-drive).
http://www.ibm.com/developerworks/li...pic1-v3-104-3/
http://www.tldp.org/HOWTO/Hard-Disk-Upgrade/mount.html

Last edited by suicidaleggroll; 11-03-2015 at 08:54 AM.
 
1 members found this post helpful.
Old 11-03-2015, 11:41 PM   #11
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
Thanks "suicidaleggroll" for your reply and guiding me. All thumbs upto you.
There is a technical reason which i want to understand regarding to it.

I am going back a bit when i did installation and keep free apace i.e 5 GB.

I use
Code:
# fdisk /dev/sda
Create anew partition (primary by pressing 4) ,save and exit from fdisk septup,restart the system and then

Code:
# mkfs.etx4 /dev/sda4
This format my free space and create ext4 file system on it.Just reboot the system.
Login ,here i can see a separate drive consisting of almost 5GB space on my desktop.

As to my problem with direction of your guidance i delete the folder from /dev/sda4 and create a folder under "/" with name "common-share"and in etc/fstab i add the line

Code:
/dev/sda4   /common-share  ext4   defaults   0   0

Restart the system.

In the "/" i can see the the folder properties which show it size almost 5 GB and with the mount command it is clearly visible that /dev/sda4 as mounted "common-share" folder.


Theoretically why it not show as a separate drive. I would be thankful if you kindly en-light on it.
Attached Thumbnails
Click image for larger version

Name:	5GB.png
Views:	22
Size:	37.4 KB
ID:	19962   Click image for larger version

Name:	mount-fstab.png
Views:	20
Size:	37.5 KB
ID:	19963   Click image for larger version

Name:	newsda4.png
Views:	19
Size:	66.4 KB
ID:	19964  
 
Old 11-03-2015, 11:57 PM   #12
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
I believe Gnome, the desktop software, only shows separate drives if they are mounted by Gnome - that is, Gnome detects the presence of currently not mounted media and mounts them automatically. Typical cases are CDROMs and USB drives.

In this case, however, the drive was already mounted at an early phase of system initialization, when fstab is processed and before Gnome started. Therefore Gnome took no action. The same is true for sda1, by the way. They all appear under the "filesystem" icon.

You seem to want to:
  1. see sda4 as a separate disk in the Gnome file manager GUI and
  2. have sda4 mounted under a specific directory, /common-share

This would require telling Gnome where to mount it. I don't know how to do that, and if it is possible.
Or perhaps you keep things as they are now but manually create an icon for common-share.

Last edited by berndbausch; 11-04-2015 at 12:01 AM.
 
1 members found this post helpful.
Old 11-04-2015, 05:36 AM   #13
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
I am thankful to "suicidaleggroll" for his valuable guidance. ,Appreciate you . thanks "berndbausch" as well.
 
Old 11-04-2015, 11:53 AM   #14
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by gardenair View Post
Theoretically why it not show as a separate drive. I would be thankful if you kindly en-light on it.
This comes down to a fundamental difference between Linux and Windows.

In Windows, every drive is separate. They all have their own unique, individual hierarchy. C: has its own hierarchy, and D: has its own which is COMPLETELY separate from the one on C:. "My Computer" HAS to show you all of the drives and partitions on the system, because there is no other way to access them.

In Linux, there is ONE hierarchy that begins at /. EVERYTHING, all directories, all files, all drives, all partitions, are found in subdirectories of this ONE hierarchy. /home is /home, it will always be /home, it will always be located at /home, and you will always reference it as /home, but there's absolutely no requirement that /home lives on the same drive or partition as /, or any of the other directories in /. /home can live on a different partition, it can live on a different drive, it can even live on a different COMPUTER remote mounted through the local network or internet, yet it will still be located at /home in the hierarchy. Your new partition sda4 now lives at /common-share, that's its spot in the hierarchy, and anything placed in /common-share will end up on sda4.

Your sda4 partition isn't being shown to you in your DE because your DE is just showing you shortcuts to the mount locations of your non-integral drives. sda4 is now in fstab, it's mounted on boot and Gnome assumes that if you've put the drive in fstab, you intend for it to be permanently mounted in that location. It doesn't give you a shortcut to it because it assumes you already know where it's mounted, because you put it there. It also doesn't give you shortcuts for sda2 mounted at /, or sda1 mounted at /boot, or tmpfs mounted at /dev/shm, because these are integral partitions that are part of your system, and you should already know where they are if you need to access them. Gnome is only going to show you the temporary partitions/drives that are auto-mounted in unique locations that you might not know where to find.
 
1 members found this post helpful.
Old 11-05-2015, 10:13 PM   #15
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 648

Original Poster
Rep: Reputation: 45
Once again I am really thankful to all especially "suicidaleggroll" that he guide me in a very good manner. Appreciate him.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any benefit of making a separate partition for home, root and boot partition Vexe Linux - Hardware 18 02-23-2013 11:00 AM
separate /boot partition, why? sluge Linux - Newbie 1 03-12-2012 02:24 AM
Need separate /var partition jholp Red Hat 12 02-21-2010 03:19 PM
Reasons to have / as separate partition? morphix Linux - Server 15 05-05-2009 11:30 AM
Mounting windows and Linux partitions on separate hard-drives vineet7kumar Solaris / OpenSolaris 1 10-09-2007 08:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 11:12 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