LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 02-27-2018, 01:02 AM   #1
scott80109
LQ Newbie
 
Registered: Feb 2018
Posts: 2

Rep: Reputation: Disabled
Question How can I mount new disk and enlarge LV?


We're running out of disk space on centos-root, and I want to enlarge the partition. This is a remote Centos 7 server halfway across the country, so I can't use anything like GParted.

Here's the `df -H` output...

Code:
Filesystem         Size  Used Avail Use% Mounted on
/dev/mapper/centos-root   54G   22G   32G  41% /
/dev/sda1                518M  334M  185M  65% /boot
/dev/mapper/centos-home   78G  104M   78G   1% /home
Here's the `fdisk -l` output...

Code:
Disk /dev/sda: 322.1 GB, 322122547200 bytes, 629145600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x0007be79

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   266338303   132656128   8e  Linux LVM

Disk /dev/sdb: 136.4 GB, 136365211648 bytes, 266338304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-root: 53.8 GB, 53754200064 bytes, 104988672 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/centos-swap: 4160 MB, 4160749568 bytes, 8126464 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/centos-home: 77.9 GB, 77921779712 bytes, 152190976 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

And finally, the `lsblk` command...

Code:
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0               2:0    1     4K  0 disk 
sda               8:0    0   300G  0 disk 
├─sda1            8:1    0   500M  0 part /boot
└─sda2            8:2    0 126.5G  0 part 
  ├─centos-root 253:0    0  50.1G  0 lvm  /
  ├─centos-swap 253:1    0   3.9G  0 lvm  [SWAP]
  └─centos-home 253:2    0  72.6G  0 lvm  /home
sdb               8:16   0   127G  0 disk 
sr0              11:0    1  1024M  0 rom

So a couple of things of note here:

1) The /dev/sda disk shows that it is 322.1 GB, yet the sda1 and sda2 partitions only combine to take up 127 GB. Where the heck is that other 195 GB, and what is it doing? How do I add it to the sda2 PV?

2) The /dev/sdb disk is apparently a new and unmounted disk. I would like to combine that 127 GB with the unused 195 GB on sda, and add that to centos-root.

Is this possible, and if so, how do I do it? I've searched all day for tutorials, but can't seem to find what I need. I'm not new to Linux, but I've never dealt with disks and partitions before. So specific details would be greatly appreciated!
 
Old 02-27-2018, 01:47 AM   #2
scott80109
LQ Newbie
 
Registered: Feb 2018
Posts: 2

Original Poster
Rep: Reputation: Disabled
I just found this excellent tutorial that solved all of my problems. I went through it twice. Once to format the unused /dev/sda space as an LVM partition and add it to the logical volume. And a second time to format the new /dev/sdb disk, and add it to the logical volume.

My centos-root disk space went from 54 GB to 376 GB!

https://www.rootusers.com/how-to-inc...-machine-disk/
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to enlarge system hard disk on HyperV VM ? percoclap23 Linux - General 11 11-11-2016 07:44 PM
How to view/mount separate disk -- move /home to second disk Spearhead40 Ubuntu 12 11-03-2007 03:37 PM
Enlarge ext3 TazG Linux - General 8 09-19-2004 10:33 AM

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

All times are GMT -5. The time now is 01:15 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
Open Source Consulting | Domain Registration