Commands using resize2fs (3)

  • Live extension of an ext3 file system on logical volume $v by 200GB without the need to unmount/remount. Requires that you have 1) a version of resize2fs that contains code merged from ext2online, and 2) kernel support for online resizing. (e.g. RHEL 5)

    v=/dev/vg0/lv0; lvextend -L+200G $v && resize2fs $v
    wwest4 · 2009-02-28 02:30:49 5
  • Just the commands for the lvreduce I keep forgetting.

    # umount /media/filesystem; e2fsck -f /dev/device ; resize2fs -p /dev/device 200G #actual newsize#;lvreduce --size 200G /dev/device; mount /media/filesystem; df -h /media/filesystem
    bbelt16ag · 2011-09-14 08:52:02 2
  • Default volume group in Ubuntu is ubuntu-vg and the logical volume is ubuntu-lv, so the provided command will resize the disk to utilize 100% of the available space. Show Sample Output

    lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv && resize2fs /dev/ubuntu-vg/ubuntu-lv
    sxiii · 2022-08-26 13:02:10 380

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Check These Out

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

vi show line numbers
you don't have to spell out numbers, you can just use nu

reset Mageia urpmi media sources to network only
On Mageia (and Mandriva) Linux, this command will clear your existing urpmi configuration and configure it to use only network sources. It can be useful after you have installed from CD/DVD and don't want to continually be prompted to insert CD/DVD each time you install a package. acknowledgement: blino

enumerate with padding
bash2 : for X in $(seq 1 5); do printf "%03g " "$X";done bash3 : for X in {1..5}; do printf "%03g " "$X";done bash4 : echo {001..5}

Convert numbers to SI notation
converts any number on the 'stdin' to SI notation. My version limits to 3 digits of precious (working with 10% resistors).

Get lines count of a list of files
This command gives you the number of lines of every file in the folder and its subfolders matching the search options specified in the find command. It also gives the total amount of lines of these files. The combination of print0 and files0-from options makes the whole command simple and efficient.

List just the executable files (or directories) in current directory
Does an 'ls' on just the files and directories in the current directory with an execute bit turned on. This version will list directories. Just tack on "-type f" to the start of the find to omit listing directories and list only files.

Analyze awk fields
Breaks down and numbers each line and it's fields. This is really useful when you are going to parse something with awk but aren't sure exactly where to start.

sort through source to find most common authors

Remove color codes (special characters) with sed

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: