Increasing the root Filesystems disk space [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
This is probably a stupid question, but I have a centos VM which I allocated a 20GB disk to. I've since realized that is way to small for my needs. In virtualbox I've increase the size of the disk by 100GB, and I've assigned that to a new physical volume in the vm. I've added that volume to the same volume group and logical group as my root file system, but I'm not seeing any change in size available to the file system.
What do I need to do to allocate more space to the file system?
[root#localhost ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 9.5M 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
/dev/mapper/centos-root 18G 17G 353M 98% /
/dev/sda1 1014M 270M 745M 27% /boot
tmpfs 1.6G 32K 1.6G 1% /run/user/1000
[root#localhost ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name centos
PV Size 19.04 GiB / not usable 0
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 4875
Free PE 0
Allocated PE 4875
PV UUID OyPa3x-9gvv-wn7u-H9V4-GZUr-NvXS-rUyb29
--- Physical volume ---
PV Name /dev/sda3
VG Name centos
PV Size <110.50 GiB / not usable 3.25 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 28287
Free PE 128
Allocated PE 28159
PV UUID gP1ANK-7qVz-91bX-I5e0-Jhhj-P12c-rlyQXm
[root#localhost ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size <129.54 GiB
PE Size 4.00 MiB
Total PE 33162
Alloc PE / Size 33034 / <129.04 GiB
Free PE / Size 128 / 512.00 MiB
VG UUID w3y0SR-KCrW-njIZ-i1yU-Wx9A-c6jJ-iLSqtM
[root#localhost ~]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID DNZWst-UWUa-pAw5-PJQ1-8UNl-AjfV-zsjTRv
LV Write Access read/write
LV Creation host, time localhost, 2020-09-01 16:00:13 +0100
LV Status available
# open 2
LV Size 2.00 GiB
Current LE 513
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID Yz0o0j-B164-JNi3-y5jd-Q9oo-EFe6-ecMgaM
LV Write Access read/write
LV Creation host, time localhost, 2020-09-01 16:00:14 +0100
LV Status available
# open 1
LV Size <127.04 GiB
Current LE 32521
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0

It seems you already resized the logical volume, so the last step is to resize the file system to match. Most current filesystems can be grown on-line while the system is running and the filesystem is mounted. Each has its own tool.
For example for ext* you would run resize2fs /dev/mapper/centos-root .
This needs no more arguments, by default it grows to the size of the partition/volume it's in.
The current default filesystem for centos is xfs, the command for that is xfs_growfs .

First tell the kernel about the new partitions using partprobe:
partprobe
we need to resize our filesystem on /dev/sda(your root volume).You can first start with checking the filesystem on the partition using the e2fsck command and then resize it.
e2fsck -f /dev/(your root volume)
resize2fs /dev/(your root volume)

Related

Linux partition not showing full size [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed last year.
Improve this question
I have a Linux system where the disk space shows as only 29Gb, but when I look at the partition with the parted - print command it shows as a 64Gb partition. I'm not sure if the remaining disk space is unallocated, mounted in other folders, stuck in "tmpfs" or how to add it to the primary partition. This is in Ubuntu 18.04 OS. I would like for the full 64 GB to be available at root. I appreciate any help!
When I run df -h, here are the results:
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 1.2M 3.2G 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 29G 25G 2.7G 91% /
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda2 976M 81M 829M 9% /boot
/dev/sda1 511M 4.4M 507M 1% /boot/efi
tmpfs 3.2G 0 3.2G 0% /run/user/1000
Results of parted print command shows a 64GB partition:
Model: ATA MSH-64 (scsi)
Disk /dev/sda: 63.4GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 boot, esp
2 538MB 1612MB 1074MB ext4
3 1612MB 63.3GB 61.7GB
Results of vgs command:
VG #PV #LV #SN Attr VSize VFree
ubuntu-vg 1 1 0 wz--n- <57.50g <28.75g
Results of the lvs command:
(talos-env) pradmin#pradmin:~$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
ubuntu-lv ubuntu-vg -wi-ao---- 28.75g
Depending on the installation, the root partition might only use a part of the logical volume (LV).
Try the commands vgs and lvs to get information about your current setup. I assume that vgs shows about 30G free space. You can enlarge the root volume using lvresize. After this you need to adapt the file system. This depends on the file system type you are using. If you use extX then you might want to run resize2fs.
Edit based on the edited question:
Yes, everything can be done when the disk is mounted and in use.
BUT YOU NEED TO TAKE CARE ABOUT THE COMMANDS YOURSELF!!! A WRONG COMMAND MIGHT DESTROY YOUR SYSTEM.
PLEASE TAKE YOUR TIME TO MAKE YOURSELF COMFORTABLE WITH LVS BEFORE CHANGING THE SYSTEM.
There are many good tutorials which might help you, e.g.:
http://ryandoyle.net/posts/expanding-a-lvm-partition-to-fill-remaining-drive-space/
The guidance from Andreas proved helpful. I managed to resize the logical volume to the full size of the partition using the following commands and sequence.
Resources that I found helpful:
https://www.redhat.com/sysadmin/resize-lvm-simple
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/storage_administration_guide/ext4grow
root:~# lvs
  LV        VG        Attr       LSize   Pool Origin
Data%  Meta%  Move Log Cpy%Sync Convert
  ubuntu-lv ubuntu-vg -wi-ao---- <57.50g
 
Here you can see that the logical volume doesn't fill the full partition size
root:~# vgs
  VG        #PV #LV #SN Attr   VSize   VFree
  ubuntu-vg   1   1   0 wz--n- <57.50g <28.75g
Extend the logical volume to 100% of the free space, /dev/{VG FROM lvs CMD}/{LV FROM lvs CMD}
root:~# lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
Size of logical volume ubuntu-vg/ubuntu-lv changed from 28.75 GiB (7360 extents) to <57.50 GiB (14719 extents).
Logical volume ubuntu-vg/ubuntu-lv successfully resized.
Checked disk space and saw that it hadn't changed yet
root:~# df
Filesystem 1K-blocks Used
Available Use% Mounted on
udev 16390292 0 16390292 0% /dev
tmpfs 3284628 1164 3283464 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 29542388 25311328 2707348 91% /
tmpfs 16423128 0 16423128 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 16423128 0 16423128 0% /sys/fs/cgroup
/dev/sda2 999320 82552 847956 9% /boot
/dev/sda1 523248 4492 518756 1% /boot/efi
tmpfs 3284624 0 3284624 0% /run/user/1000
Resize file system to full size of logical volume, use Filesystem name from df command above. Note this is an ext4 filesystem, you may have to use a different command for a different filesystem.
root:~# resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs 1.44.1 (24-Mar-2018)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line
resizing required
old_desc_blocks = 4, new_desc_blocks = 8
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 15072256 (4k) blocks
long.
root:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 16390292 0 16390292 0% /dev
tmpfs 3284628 1164 3283464 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 59211724 25319316 31128948 45% /
tmpfs 16423128 0 16423128 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 16423128 0 16423128 0%
/sys/fs/cgroup
/dev/sda2 999320 82552 847956 9% /boot
/dev/sda1 523248 4492 518756 1% /boot/efi
tmpfs 3284624 0 3284624 0%
/run/user/1000

could not figure out how much is one extent?

i got the homework from Devops school and one of LVM question below , i am confused with extents , teacher said that it should be calculated like this : 20x25 = 500 mb --> so the partition supposed to be made about 600 mb with extra space ! But from my google researches i found that 1 extent = 4 MB , 25x4 = 100 LVM=80MB ???
Create logical volume "datashare" inside volume group called "datagroup"
Create volume group "datagroup" from partition using 25M extents
Create logical volume with 20 extents /dev/datagroup/datashare
The disk I am using is 20GB in total size.
[root#centos7 ~]# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdb 8:16 0 20G 0 disk
I create my first Physical Volume.
[root#centos7 ~]# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.
I create my first Volume Group setting 32MG as the Physical Extentsize (PE) size, default 4MB, this defines how the space is being allocated (chunks of PE size).
[root#centos7 ~]# vgcreate -s 32M myvg /dev/sdb
Volume group "myvg" successfully created
So my /dev/sdb disk size is 20GB, then I created the PV pvcreate, after this I created a new Volume Group with the Physical Extentsize (PE) size of 32MB.
Then I confirm this by the PE Size column.
[root#centos7 ~]# vgdisplay myvg
--- Volume group ---
VG Name myvg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size <19.97 GiB
PE Size 32.00 MiB
Total PE 639
Alloc PE / Size 0 / 0
Free PE / Size 639 / <19.97 GiB
VG UUID m3wDvh-i0aH-5Zr2-0ya7-1GaA-mLb2-Umd9x3
SO here is the math disk 20GB to MB (20 * 1024 = 20480).
Then 20480 MB (Total disk 20GB) / 32 MB (The size I wanted my PE) = 640 (vgdisplay shows Total PE 639 because rounded values probably we did not have exactly 32 MB to have the last PE to have exactly 640 as expected.)
So if you need to create a new Logical Volume (LV):
You can use PE (which is 32MG and we have 639 available to use), so let say I want a new LV with 50 PE, 50 * 32 MB (PE size) = 1600 MB / 1.6 GB. (Please note Current LE 50 from PE it changes to Logical Extent)
[root#centos7 ~]# lvcreate -l 50 -n mylv1 myvg
Logical volume "mylv1" created.
[root#centos7 ~]# lvdisplay /dev/myvg/mylv1
--- Logical volume ---
LV Path /dev/myvg/mylv1
LV Name mylv1
VG Name myvg
LV UUID BuQsPK-UKWL-tdVv-bFkR-X2md-zG3o-xzQIKk
LV Write Access read/write
LV Creation host, time centos7, 2021-10-10 20:38:33 +0000
LV Status available
# open 0
LV Size 1.56 GiB
Current LE 50
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
or
You can ask LVM to create an LV with a specific size like 950 MB so 950 / 32 MB (PE) = 29.6875 but it can not use 29.6875 PE because it needs to be rounded up to use 30 PE (Current LE 30).
[root#centos7 ~]# lvcreate -L 950MB -n mylv2 myvg
Rounding up size to full physical extent 960.00 MiB
Logical volume "mylv2" created.
[root#centos7 ~]# lvdisplay /dev/myvg/mylv2
--- Logical volume ---
LV Path /dev/myvg/mylv2
LV Name mylv2
VG Name myvg
LV UUID eJrAY2-Pb1x-VBbq-k8cI-vIlq-Tg3s-CsRFsB
LV Write Access read/write
LV Creation host, time centos7, 2021-10-10 20:40:33 +0000
LV Status available
# open 0
LV Size 960.00 MiB
Current LE 30
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1

Resizing an EXT4 Partition [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
I have an Ubuntu 18.04 server in a VM. The VM administrator has allocated more disk space. How do I resize a partition to use that space?
My setup is as follows:
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 5244927 4194304 2G Linux filesystem
/dev/sda3 5244928 424675327 419430400 200G Linux filesystem
/dev/sda4 424675328 529532927 104857600 50G Linux filesystem
/dev/sda5 529532928 1578108927 1048576000 500G Linux filesystem
/dev/sda6 1578108928 1745881087 167772160 80G Linux filesystem
(parted) print free space
Model: Msft Virtual Disk (scsi)
Disk /dev/sda: 1397GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
17.4kB 1049kB 1031kB Free Space
1 1049kB 538MB 537MB fat32 boot, esp
2 538MB 2685MB 2147MB ext4
3 2685MB 217GB 215GB ext4
4 217GB 271GB 53.7GB ext4
5 271GB 808GB 537GB ext4
6 808GB 894GB 85.9GB ext4
894GB 1397GB 503GB Free Space
How can I assign that free space to the fifth partition.
Following the instructions in:
https://geekpeek.net/resize-filesystem-fdisk-resize2fs/
I deleted /dev/sda5 and then recreated it, but it remained the same size:
Similarly, following:
https://www.tecmint.com/parted-command-to-create-resize-rescue-linux-disk-partitions/
resizepart doesn't suggest that there's any available disk space to use and the partition remains the same size.
Do I need to remove /dev/sda6 to get access to the available disk space?
If you want to assign free space to partition /dev/sda5 from inside the VM you will first have to get rid of /dev/sda6 partition.
Otherwise the solution is to run GParted from a live CD while the filesystem is not mounted, because you will have to move partitions (in your case, you would have to move the /dev/sda6 partition to the end of the disk, then expand /dev/sda5 with its now adjacent free space).

Linux CENTOS7 LVM [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
Here's the output of my df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 34G 17G 67% /
devtmpfs 2.5G 0 2.5G 0% /dev
tmpfs 2.5G 140K 2.5G 1% /dev/shm
tmpfs 2.5G 8.9M 2.5G 1% /run
tmpfs 2.5G 0 2.5G 0% /sys/fs/cgroup
/dev/sda1 497M 133M 365M 27% /boot
I'd like to increase the size of / by 194 GB.
I ran the command lvextend -L +194G /dev/mapper/centos-root
I got he message that the filesystem has been resized. I rebooted the system. I'm expecting to see my / to be 244GB. However it isn't
VOLUME GROUP DETAILS
[root#localhost mapper]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 249.51 GiB
PE Size 4.00 MiB
Total PE 63874
Alloc PE / Size 63648 / 248.62 GiB
Free PE / Size 226 / 904.00 MiB
VG UUID icZPDf-z0cO-5qMl-Gbtr-XisU-6ptl-cpG3dz
LOGICAL VOLUME DETAILS
[root#localhost mapper]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID MzofJC-7I6W-XcM9-xwrT-Ns86-LdYt-OYltON
LV Write Access read/write
LV Creation host, time localhost, 2015-07-02 09:04:52 +1200
LV Status available
# open 2
LV Size 4.62 GiB
Current LE 1184
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID 1J50kj-hcBC-T5rY-y6LV-0xEI-ZVId-qBfgQl
LV Write Access read/write
LV Creation host, time localhost, 2015-07-02 09:04:53 +1200
LV Status available
# open 1
LV Size 244.00 GiB
Current LE 62464
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
/etc/fstab OUTPUT
#
# /etc/fstab
# Created by anaconda on Thu Jul 2 09:04:53 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root / xfs defaults 0 0
UUID=c4f605aa-56b0-4bde-ae0b-ddf6f0e4a983 /boot xfs defaults 0 0
#/dev/mapper/centos-home /home xfs defaults 0 0
/dev/mapper/centos-swap swap swap defaults 0 0
How do I extend /dev/mapper/centos-root? Any help?
Instead of "lvextend -L +194G /dev/mapper/centos-root", use "lvextend -L +194G -r /dev/mapper/centos-root".
The -r option changes the logical volume and the associated file system sizes in only one step. In addition, this works for ext4 and xfs.
Also, don't use "df", use "lsblk", the display is much clearer.
AH, I hadn't bumped on this link - https://themacwrangler.wordpress.com/2015/01/16/re-sizing-partitions-in-centos7/. Very helpful.
I had to grow the filesystem too which I hadn't. Good learning.
Copying the contents of the page at the above link here just in case the content becomes unavailable in future.
Re-sizing partitions in Centos7
By default in a CentOS7 install we get a couple of partitions created for the root user and one for home usually something like this:
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 2.7G 48G 6% /
devtmpfs 239M 0 239M 0% /dev
tmpfs 246M 0 246M 0% /dev/shm
tmpfs 246M 29M 217M 12% /run
tmpfs 246M 0 246M 0% /sys/fs/cgroup
/dev/mapper/centos-home 29G 33M 29G 1% /home
/dev/sda1 497M 96M 401M 20% /boot
Note that the root partition is 50Gb and the home partition is 29Gb
Often I find myself wanting or needing to remove the centos-home partition and expand the centos-root partition.
It is a pretty straight forward exercise, but one that I often forget the steps involved.
So here they are:
• First backup any data that might exist in /home so you can restore it later.
• Unmount the centos-home partition.
# umount /home/
• Next show the logical volumes.
# lvdisplay
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID azXfXa-YPiG-Bx9x-NfIO-eswN-iHVw-YsXpYe
LV Write Access read/write
LV Creation host, time localhost, 2014-12-01 13:02:00 +1100
LV Status available
# open 2
LV Size 1.03 GiB
Current LE 264
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Path /dev/centos/home
LV Name home
VG Name centos
LV UUID LtYf7h-h1kx-p7OR-ZdN8-2Xo8-KXYT-uC2Roa
LV Write Access read/write
LV Creation host, time localhost, 2014-12-01 13:02:01 +1100
LV Status available
# open 0
LV Size 28.48 GiB
Current LE 7290
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID DjnSO6-gsbN-g83Q-VhfC-u3Ft-8DqY-sPMx35
LV Write Access read/write
LV Creation host, time localhost, 2014-12-01 13:02:03 +1100
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
•Now remove the logical volume for centos-home.
# lvremove /dev/centos/home
Do you really want to remove active logical volume home? [y/n]: y
Logical volume "home" successfully removed
•You should now have the free space available in VFree when you have a look using vgs.
# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 2 0 wz--n- 79.51g 28.48g
• Now resize the centos-root partition.
# lvresize -L +28.47GB /dev/mapper/centos-root
Rounding size to boundary between physical extents: 28.47 GiB
Extending logical volume root to 78.47 GiB
Logical volume root successfully resized
Note that I expanded the partition by slightly less than the available space, 28.47Gb instead of 28.48Gb, this is just to make sure you avoid hitting an insufficient free space error.
• Grow the partition to use all the free space
#xfs_growfs /dev/mapper/centos-root
• Confirm your new partition size.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 79G 2.7G 76G 4% /
devtmpfs 239M 0 239M 0% /dev
tmpfs 246M 0 246M 0% /dev/shm
tmpfs 246M 29M 217M 12% /run
tmpfs 246M 0 246M 0% /sys/fs/cgroup
/dev/sda1 497M 96M 401M 20% /boot

missing partition in server centos 6.1

I used the command df-h on my centos 6.1
here's the output
[root#localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
50G 2.3G 45G 5% /
tmpfs 5.9G 0 5.9G 0% /dev/shm
/dev/sda1 485M 35M 425M 8% /boot
/dev/mapper/VolGroup-lv_home
2.0T 199M 1.9T 1% /home
i found out that the hard disk is two terabyte. but when I used the command cat /proc/partitions | more
here's the output
[root#localhost sysconfig]# cat /proc/partitions | more
major minor #blocks name
8 0 4293656576 sda
8 1 512000 sda1
8 2 2146970624 sda2
253 0 52428800 dm-0
253 1 14417920 dm-1
253 2 2080120832 dm-2
you could see on the first line. it is 4396.7 GB . why is it i could only see is 2TB? how could i find my missing another 2TB and make it a partition.
I also use the command lsblk
here is the output
[root#localhost ~]# lblsk
-bash: lblsk: command not found
[root#localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO MOUNTPOINT
sda 8:0 0 4T 0
ââsda1 8:1 0 500M 0 /boot
ââsda2 8:2 0 2T 0
ââVolGroup-lv_root (dm-0) 253:0 0 50G 0 /
ââVolGroup-lv_swap (dm-1) 253:1 0 13.8G 0 [SWAP]
ââVolGroup-lv_home (dm-2) 253:2 0 2T 0 /home
sr0 11:0 1 1024M 0
using the parted /dev/sda i type the print free command
here's the output
(parted) print free
Model: DELL PERC 6/i (scsi)
Disk /dev/sda: 4397GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
32.3kB 1049kB 1016kB Free Space
1 1049kB 525MB 524MB primary ext4 boot
2 525MB 2199GB 2198GB primary lvm
2199GB 4397GB 2198GB Free Space
I was wrong, sorry. As you can see in parted print free output you have 2 MBR partitions - boot and lvm and 2198GB free space (last row).
If you want to use all of your space you have to use GPT partitions. These partitions as opposed to MBR partition that can only address up to 2TB, can address your whole disk and up to 8 ZiB (zebibytes).
You can try to convert MBR partition table to GPT (example 1, example 2), though I strongly recommend to backup your data.
You are using tools showing info from different layers of your system and interpreting it wrong.
df, according to man page, will display the space available on all currently mounted file systems.
/proc/partitions holds info about partitions on your drive - physical device. This file shows you size of your drive as number of blocks. Usually, on HDD block size is a size of sector - 512 bytes.
So, sda size of 4293656576 is size in blocks, not kilobytes.
4293656576 blocks = (4293656576 / 2 ) kilobytes = 2146828288 KiB = 2047.375 GiB, or 2198.352 GB.
Assuming 1 GiB = 1 * 2^30, 1 GB = 1 * 10^3.
If you want to see size of your disk use fdisk -l <device name>.

Resources