LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-26-2016, 11:46 AM   #1
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Ubuntu 16.04
Posts: 413

Rep: Reputation: 74
Logical Volume Management (LVM) Code Verification


Before running the operation below, I would like to verify that the code to create the file system in a logical volume is correct. The concern relates to the use of the hyphen "-".

The website I am using for the refernce material is ArchLinux.org.

My fstab file has the line: /dev/mapper/ubuntu--vg-root where the logical group is "ubuntu--vg" and the volume is "root". I plan to shrink root and create a new volume "newhome". Which will eventually become the "home" directory. After creating the new volume, the file system needs to be established.

The example provided by ArchLinux for creating the file system is below:
Code:
mkfs.ext4 /dev/mapper/VolGroup00-lvolhome
note the hyphen above. The version I would plan to use is shown below.
Code:
mkfs.ext4 /dev/mapper/ubuntu--vg-newhome
Will the double hyphens in the code above present a problem?

Last edited by Steve R.; 04-26-2016 at 11:52 AM.
 
Old 04-26-2016, 01:53 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,360

Rep: Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001Reputation: 2001
Because the "-" character is used as a separator between the VG and LV names in /dev/mapper, a literal "-" character within the VG name gets doubled. These both reference the same LV:
Code:
/dev/mapper/ubuntu--vg-newhome
/dev/ubuntu-vg/newhome

Last edited by rknichols; 04-26-2016 at 01:57 PM. Reason: show in a code block for clarity
 
1 members found this post helpful.
Old 04-26-2016, 01:58 PM   #3
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
In Fedora you'd use
Quote:
/dev/<volgroup>/<lv>
 
1 members found this post helpful.
Old 04-26-2016, 04:11 PM   #4
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Ubuntu 16.04
Posts: 413

Original Poster
Rep: Reputation: 74
Thanks. It worked. I have a new volume "newhome" now. Yeah.
When doing this stuff, I always have the feeling of massive impending doom.

Tomorrow, I will complete the process by moving the files in my "home" directory to the "newhome" volume and rename it "home" after changing the prior home directory to "home_old".

Last edited by Steve R.; 04-26-2016 at 07:39 PM.
 
Old 04-27-2016, 08:30 AM   #5
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Ubuntu 16.04
Posts: 413

Original Poster
Rep: Reputation: 74
Success. "home" now resides in its own volume. Thanks for the guidance.
 
Old 04-27-2016, 07:22 PM   #6
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Glad you have success.

When I first used lvm I wasn't a big fan, but the more I use lvm volumes the more I'm happy with lvm stability and flexibility. However, I do resist spanning multiple physical disks in a lvm volume.
 
Old 04-28-2016, 12:40 PM   #7
Steve R.
Member
 
Registered: Jun 2009
Location: Morehead City, NC
Distribution: Ubuntu 16.04
Posts: 413

Original Poster
Rep: Reputation: 74
Quote:
Originally Posted by Doug G View Post
Glad you have success.

When I first used lvm I wasn't a big fan, but the more I use lvm volumes the more I'm happy with lvm stability and flexibility. However, I do resist spanning multiple physical disks in a lvm volume.
I'm still to new to LVM to appreciate it, especially for home use. It was a tremendous learning experience. Given time, I may appreciate its benefits.

As I was not able locate a suitable tutorial for creating a logical volume dedicated to the "home" directory, I developed one of my own based on feedback from my posts and my experience: Create Logical "Home" Volume When Using Logical Volume Management (VLM). I believe in having the operating system and user files on different "partitions" (volumes). Others may find this tutorial useful should they want to have a logical volume dedicated to "home".
 
  


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] Logical Volume Management (LVM) Disk Tangle? DaveGinBoav Linux - Software 11 03-03-2016 08:00 PM
LVM Mount Physical Volume/Logical Volume without a working Volume Group mpivintis Linux - Newbie 10 01-11-2014 08:02 AM
Extended LVM Volume group and Logical Volume. But space not usable linuxlover.chaitanya Linux - Server 1 11-19-2012 10:37 AM
Logical Volume Management 2 XaViaR Linux - General 5 08-20-2005 08:48 AM
Logical Volume Management jatimon Linux - General 0 04-17-2002 03:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration