• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

resize2fs: commnd not found

by admin

The resize2fs command is used to enlarge or shrink an ext2/3/4 file system on a device. You can enlarge a mounted file system, but you must unmount the file system before you can shrink it. You can specify the desired size of the file system in order to either enlarge or shrink it. If you don’t specify a size, the file system will be resized to the same size as the partition.

It’s important to note that resize2fs does not resize partitions, only the file system. You must use a command like fdisk or an LVM tool to expand the size of the partition/ volume first in order to then enlarge the file system.

Syntax

The syntax of the resize2fs command is:

# resize2fs [options] {device/file system name} [desired size]

If you encounter the below error while running the resize2fs command:

resize2fs: command not found

you may install below package as per your choice of distribution:

Distribution Command
OS X brew install e2fsprogs
Debian apt-get install e2fsprogs
Ubuntu apt-get install e2fsprogs
Alpine apk add e2fsprogs
Arch Linux pacman -S e2fsprogs
Kali Linux apt-get install e2fsprogs
CentOS yum install e2fsprogs
Fedora dnf install e2fsprogs
Raspbian apt-get install e2fsprogs

resize2fs Command Examples

1. To resize a recently extended file system:

# resize2fs /dev/mapper/VG02-LV05 

2. To forcefuly resize the file system:

# resize2fs -f /dev/mapper/VG02-LV05 

3. To flush the filesystem device’s buffer caches:

# resize2fs -F /dev/mapper/VG02-LV05 

4. To shrink the filesystem to the minimum size:

# resize2fs -M /dev/mapper/VG02-LV05 

5. To prints out a percentage completion bars for each resize2fs operation:

# resize2fs -p /dev/mapper/VG02-LV05 

6. To Print the minimum size of the filesystem and exit:

# resize2fs -P /dev/mapper/VG02-LV05 

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to find which rpm package provides a specific file or library in RHEL / CentOS
  2. CentOS / RHEL 6,7 : How to increase system log message verbosity (rsyslogd)
  3. “yum update” fails with “[package version 1] is a duplicate with [package version 2]”
  4. getent: command not found
  5. ssh-keygen: command not found
  6. lsscsi: command not found
  7. iperf: command not found
  8. disown Command Examples in Linux
  9. visudo: command not found
  10. eject: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright