Main Menu

Search

Showing posts with label volume. Show all posts
Showing posts with label volume. Show all posts

LINUX: fdisk Command To Check the Size of Partitions / Volumes/ Disks (How To Doc)

Below fdisk command can be used to check the size of all the partitions, volumes, disks on Linux Machine.
fdisk -l

Below is example snippet of above command.

Disk /dev/xvdb: 107.4 GB, 107374182400 bytes
64 heads, 32 sectors/track, 102400 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1               2      102400   104856576   83  Linux

Disk /dev/mapper/VolGroup00-LogVol01: 34.4 GB, 34359738368 bytes
255 heads, 63 sectors/track, 4177 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/VolGroup00-LogVol00: 33.8 GB, 33831256064 bytes
255 heads, 63 sectors/track, 4113 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

If you want to check the size of specific partition, volume below command can be used.

fdisk -s <name>

Below is example.
fdisk -s /dev/mapper/VolGroup00-LogVol00

Below is example snippet of above command.
# fdisk -s /dev/mapper/VolGroup00-LogVol00
33038336

Products to which Article Applies


All Linux Operating Systems

 

Additional Reference

 

https://www.tecmint.com/fdisk-commands-to-manage-linux-disk-partitions/

LINUX: Commands For Getting Information on Logical Volumes (How To Doc) (lvs commands)

Below commands can be used be used for getting information on logical volumes and volume groups on Linux hosts.

lvdisplay


lvdisplay

This command displays all the logical volumes with all the details like LV Path, Volume & Group name, size etc. Below is sample output.
  --- Logical volume ---
  LV Path                /dev/VolGroup00/LogVol01
  LV Name                LogVol01
  VG Name                VolGroup00
  LV UUID                MwEadG-LSm3-Abl1-Poxp-M9or-z6O3-wvt1eY
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2014-02-20 07:21:52 -0500
  LV Status              available
  # open                 2
  LV Size                512.00 MiB
  Current LE             128
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

lvs -o +devices


lvs -o +devices

This command lists all the logical devices corresponding to logical volume. Below is sample output.
 LV       VG         Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert Devices
  LogVol00 VolGroup00 -wi-ao----   7.00g                                              /dev/xvda2(128)
  LogVol01 VolGroup00 -wi-ao---- 512.00m                                              /dev/xvda2(0)

lsblk


lsblk

This command gives the device name dm-* to which the logical volumes are mapped. Below are sample outputs.
[root@host ~]# lsblk
NAME                           MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
xvda                           202:0    0   10G  0 disk
├─xvda1                        202:1    0  250M  0 part /boot
└─xvda2                        202:2    0  9.8G  0 part
  ├─VolGroup00-LogVol01 (dm-0) 252:0    0  512M  0 lvm  [SWAP]
  └─VolGroup00-LogVol00 (dm-1) 252:1    0    7G  0 lvm  /
xvdb                           202:16   0   32G  0 disk
[root@tboyella-ol6-logical-volume ~]#

Products to which Article Applies


All Linux Operating Systems

Additional Reference

https://www.systutorials.com/docs/linux/man/8-lvs/