

The df command in Linux is probably one of the most commonly used. Let’s see what commands you can use to show disk info in Linux. Please note that some of these commands are actually disk partitioning tools and listing disk partition is one of their features. Here are some different commands which can list the hard drives, keep in mind there are others but these are probably the most commonly used and easy to get the job done. Keep in mind a hard drive could be physically connected, virtually connected or even emulated (for example: when you use storage devices such as EMC, Sun or IBM). The filesystem on /dev/DBDATA/mysql is now 65528832 blocks long.There are several ways to list all the hard drives present in a system through Linux command lines. Performing an on-line resize of /dev/DBDATA/mysql to 65528832 (4k) blocks. Old desc_blocks = 13, new_desc_blocks = 16 # Finally Resize the files system of the partitonįilesystem at /dev/DBDATA/mysql is mounted on /data2 on-line resizing required Logical volume mysql successfully resized # Get the device name of logical partitionĮxtending logical volume mysql to 249.97 GiB Volume group "DBDATA" successfully extended Physical volume "/dev/sdc6" successfully created No physical volume label read from /dev/sdc6 # Extend the Volume group with the /dev/sdc6
Rhel rescan disks install#
# Install parted package to get the partprobe tool
Rhel rescan disks free#
# We work on /dev/sdc then we create a new partition in it.Ĭreate a new Logical partition with the free space (/dev/sdc6)Ĭreated new Partition /dev/sdc6 Size: 53686.41 MB # Let have a look at which HDD we ween to work on.ĭisk /dev/dm-0 doesn't contain a valid partition tableĭisk /dev/sda: 25.8 GB, 25769803776 bytes – Take a security snapshot (in cse things go wrong)įilesystem Size Used Avail Use% Mounted on Mount -a Example with a VMWARE VM and LVM involved You can now remount the partition to the original mount point. The filesystem on /dev/sdb1 is now 47184905 blocks long. Resizing the filesystem on /dev/sdb1 to 47184905 (4k) blocks. – Resize the file system for that partition.

– Delete the existing partition and create a new one with the needed size and quit. Now the file system should be resized appropriately: This should display a bigger size of the hard disk: In case that doesn’t work you can tell the kernel to re-scan the already known disks only:Įcho "-" > /sys/class/scsi_host/host0/scanĮcho "-" > /sys/class/scsi_host/host1/scanĮcho "-" > /sys/class/scsi_host/host2/scan That also finds new disks if it’s the case.Įcho 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescanĮcho 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescanĮcho 1 > /sys/class/scsi_device/2\:0\:1\:0/device/rescan (unless you know exactly which one is concerned). Provoke a re-sync of the kernel for all the SCSI devices dev/sdb1įind out which SCSI devices are involved:

For the kernel to recognize that a virtual disk has changed size. Sometimes I need to resize a virtual disk for a virtual machine without having to reboot the machine.
