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 04-02-2017, 02:26 PM   #1
zillur
Member
 
Registered: Apr 2015
Posts: 217

Rep: Reputation: Disabled
Define partition and mount point


Hi there,
My system is like following:
Code:
[zillur@localhost ~]$ df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/cl-root   50G  4.2G   46G   9% /
devtmpfs              87G     0   87G   0% /dev
tmpfs                 87G   84K   87G   1% /dev/shm
tmpfs                 87G  9.7M   87G   1% /run
tmpfs                 87G     0   87G   0% /sys/fs/cgroup
/dev/sdb1           1014M  140M  875M  14% /boot
/dev/mapper/cl-home   26T   66M   26T   1% /home
tmpfs                 18G   48K   18G   1% /run/user/1000
[zillur@localhost ~]$ lsblk 
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0  14.6T  0 disk 
└─sda1        8:1    0  14.6T  0 part 
  └─cl-home 253:2    0  25.5T  0 lvm  /home
sdb           8:16   0 111.8G  0 disk 
├─sdb1        8:17   0     1G  0 part /boot
└─sdb2        8:18   0 110.8G  0 part 
  ├─cl-root 253:0    0    50G  0 lvm  /
  └─cl-home 253:2    0  25.5T  0 lvm  /home
sdc           8:32   0  10.9T  0 disk 
└─sdc1        8:33   0  10.9T  0 part 
  ├─cl-swap 253:1    0     4G  0 lvm  [SWAP]
  └─cl-home 253:2    0  25.5T  0 lvm  /home
sr0          11:0    1  1024M  0 rom  
sr1          11:1    1  1024M  0 rom  
[zillur@localhost ~]$ pvs
  WARNING: Running as a non-root user. Functionality may be unavailable.
  /run/lvm/lvmetad.socket: access failed: Permission denied
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  /run/lock/lvm/P_global:aux: open failed: Permission denied
  Unable to obtain global lock.
[zillur@localhost ~]$ sudo pvs

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for zillur: 
  PV         VG Fmt  Attr PSize   PFree
  /dev/sda1  cl lvm2 a--   14.55t    0 
  /dev/sdb2  cl lvm2 a--  110.79g    0 
  /dev/sdc1  cl lvm2 a--   10.92t    0 
[zillur@localhost ~]$ vgs
  WARNING: Running as a non-root user. Functionality may be unavailable.
  /run/lvm/lvmetad.socket: access failed: Permission denied
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  /dev/mapper/control: open failed: Permission denied
  Failure to communicate with kernel device-mapper driver.
  Incompatible libdevmapper 1.02.135-RHEL7 (2016-09-28) and kernel driver (unknown version).
[zillur@localhost ~]$ sudo vgs
  VG #PV #LV #SN Attr   VSize  VFree
  cl   3   3   0 wz--n- 25.58t    0
I want to create a mount point like:
Code:
/backup
then I want to allocate 10 TB to my /backup
and rest of the disk space may remain in /home

Is it possible??

Best Regards
zillur
 
Old 04-02-2017, 03:23 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,599

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
yes ..
http://www.thegeekstuff.com/2010/08/how-to-create-lvm
 
1 members found this post helpful.
Old 04-02-2017, 03:41 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,360

Rep: Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001
You can do it, but since there is no unallocated space you will have to shrink the cl/home LV and filesystem to make space. Note that keeping a backup on the same disk does not give any protection against disk failure or damage to the partitioning or LVM structure. I presume you have some other goal for that backup.

You cannot shrink a filesystem while it is mounted, and an XFS filesystem cannot be shrunk at all. For non-XFS filesystems, you will need to boot single user, unmount /home, and then resize the LV and filesystem. (All of the following commands need to be run as root.)
Code:
umount /home
lvreduce --resizefs --size -10T cl/home
Now you can create a new LV and filesystem.
Code:
lvcreate --extents 100%FREE -n backup cl
mkfs.{whatever} /dev/mapper/cl-backup
Then you just need to create the /backup mount point directory and put an entry in /etc/fstab if you want it mounted automatically.
 
1 members found this post helpful.
Old 04-06-2017, 08:19 AM   #4
zillur
Member
 
Registered: Apr 2015
Posts: 217

Original Poster
Rep: Reputation: Disabled
Thank you very much for helping me all the way. My current system is like following:
Code:
[zillur@localhost ~]$ df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/cl00-root   50G  4.0G   46G   8% /
devtmpfs                87G     0   87G   0% /dev
tmpfs                   87G  116K   87G   1% /dev/shm
tmpfs                   87G   66M   87G   1% /run
tmpfs                   87G     0   87G   0% /sys/fs/cgroup
/dev/sdb2             1014M  205M  810M  21% /boot
/dev/mapper/cl00-home   56G  107M   56G   1% /home
tmpfs                   18G   36K   18G   1% /run/user/1000
/dev/sda1               15T   19M   14T   1% /gondor
/dev/sdg1               11T   61M   11T   1% /mordor
and:
Code:
[zillur@localhost ~]$ sudo pvscan 
  PV /dev/sdb3   VG cl00            lvm2 [109.79 GiB / 0    free]
  Total: 1 [109.79 GiB] / in use: 1 [109.79 GiB] / in no VG: 0 [0   ]
[zillur@localhost ~]$ sudo lvscan 
  ACTIVE            '/dev/cl00/swap' [4.00 GiB] inherit
  ACTIVE            '/dev/cl00/home' [55.79 GiB] inherit
  ACTIVE            '/dev/cl00/root' [50.00 GiB] inherit
[zillur@localhost ~]$ sudo vgscan 
  Reading volume groups from cache.
  Found volume group "cl00" using metadata type lvm2
Do you guys think its a good idea? I don't have any volume group or logical volume for /dev/sda1 and /dev/sdg1. Can I run a system like this where users will login and then work in /gondor and /mordor ?? Need your suggestions.

Best Regards
Zillur
 
Old 04-06-2017, 08:26 AM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,599

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
Quote:
Originally Posted by zillur View Post
Thank you very much for helping me all the way. My current system is like following:
Code:
[zillur@localhost ~]$ df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/cl00-root   50G  4.0G   46G   8% /
devtmpfs                87G     0   87G   0% /dev
tmpfs                   87G  116K   87G   1% /dev/shm
tmpfs                   87G   66M   87G   1% /run
tmpfs                   87G     0   87G   0% /sys/fs/cgroup
/dev/sdb2             1014M  205M  810M  21% /boot
/dev/mapper/cl00-home   56G  107M   56G   1% /home
tmpfs                   18G   36K   18G   1% /run/user/1000
/dev/sda1               15T   19M   14T   1% /gondor
/dev/sdg1               11T   61M   11T   1% /mordor
and:
Code:
[zillur@localhost ~]$ sudo pvscan 
  PV /dev/sdb3   VG cl00            lvm2 [109.79 GiB / 0    free]
  Total: 1 [109.79 GiB] / in use: 1 [109.79 GiB] / in no VG: 0 [0   ]
[zillur@localhost ~]$ sudo lvscan 
  ACTIVE            '/dev/cl00/swap' [4.00 GiB] inherit
  ACTIVE            '/dev/cl00/home' [55.79 GiB] inherit
  ACTIVE            '/dev/cl00/root' [50.00 GiB] inherit
[zillur@localhost ~]$ sudo vgscan 
  Reading volume groups from cache.
  Found volume group "cl00" using metadata type lvm2
Do you guys think its a good idea? I don't have any volume group or logical volume for /dev/sda1 and /dev/sdg1. Can I run a system like this where users will login and then work in /gondor and /mordor ?? Need your suggestions.

Best Regards
Zillur

I do not know much of anything about LVM but I do suppose it cannot be much different when it comes to setting it up to be used in Linux via the fstab and mount methodology.

where mount and bind commands are put to use. therefore if you want someone to log in and work or have their home directory be on a different volume. I do not see why one could not just used mount then bind to set that particular person in a different volume then the others are in whenever they log in. While it will look like he is on the same volume it is not so. Due to binding his /home/user to a different volume /directory to his entire /home/user area.

http://backdrift.org/how-to-use-bind-mounts-in-linux

Last edited by BW-userx; 04-06-2017 at 08:29 AM.
 
1 members found this post helpful.
Old 04-06-2017, 08:37 AM   #6
zillur
Member
 
Registered: Apr 2015
Posts: 217

Original Poster
Rep: Reputation: Disabled
Thank you very much for a quick reply. I also don't know anything on partitioning or LVM. In my current system, I want users will login normally and cd to /gondor or /mordor to use /dev/sdg1 or /dev/sda1. Is it possible without changing anything? Do you think "chown user /mordor" will be sufficient?

Best Regards
Zillur
 
Old 04-06-2017, 09:07 AM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,599

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
Quote:
Originally Posted by zillur View Post
Thank you very much for a quick reply. I also don't know anything on partitioning or LVM. In my current system, I want users will login normally and cd to /gondor or /mordor to use /dev/sdg1 or /dev/sda1. Is it possible without changing anything? Do you think "chown user /mordor" will be sufficient?

Best Regards
Zillur
where /gondor or /mordor I take it are just directories where you want others to work in. then all they have to do is cd into it. and yes just change its permissions.

you can keep control of it while giving certain permissions to others as well to either read, or read write, or read, write and execute within any directory.


Your line of thought is correct in thinking that chown will work. Their is also many other ways to get this done.

Keeping in mind this is a root user permissions that can only do this with others stuff. and a user permissions that can do this with one own "stuff".

Code:
chmod u=rwx,g=rx,o=r /DirectoryName
chmod u=rwx,g=rx,o=r file
as you see it can be broken into parts to set permission onto an item in any fashion one wants as long as it stays within the limits given that allows this to be done.
Code:
chown user:group /directory

chown root:users /mordor
chmod u=rwx g=r  o-rwx /mordor
You can still allow root to own the directory so no one else can delete it. then do this in any fastion you wish.

User gets read, write, and execute,Group gets read only, Other gets nothing, the minus '-' removes permissions. the equal '=' adds permissions.

Making sure that the users that you want to use that directory are assigned to the group.
Code:
usermod -aG users UserName
u = User (owner)
g = Group
o = Others or anyone else that can get inside of a directory, but when the other has all permissions removed then what takes place?

https://www.linode.com/docs/tools-re...ons-with-chmod

Last edited by BW-userx; 04-06-2017 at 09:11 AM.
 
1 members found this post helpful.
Old 04-06-2017, 09:13 AM   #8
zillur
Member
 
Registered: Apr 2015
Posts: 217

Original Poster
Rep: Reputation: Disabled
Thank you very much.
 
Old 04-06-2017, 09:28 AM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware FreeBSD Win10 MX
Posts: 9,599

Rep: Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071Reputation: 2071
you're very welcome

Last edited by BW-userx; 04-06-2017 at 09:29 AM.
 
  


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] mount point for windows partition bluegospel Slackware - Installation 7 04-26-2010 12:17 AM
mount point for new partition bluefishkiller Linux - Desktop 2 07-16-2007 02:58 PM
More than one mount point on one partition? essdeeay Linux - General 3 02-22-2006 01:43 PM
mount point limitations in an extended partition code404 Linux - General 5 12-06-2002 03:33 PM

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

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