Commands tagged ext4 (5)

  • Before doing this, back-up all data on any ext3 partitions that are to be converted to ext4. After running previous command you MUST run fsck, is needed to return the filesystem to a consistent state. fsck -pDf /dev/yourpartition Edit /etc/fstab and change the 'type' from ext3 to ext4 for any partitions that are converted to ext4.


    5
    tune2fs -O extents,uninit_bg,dir_index /dev/yourpartition
    starchox · 2009-06-23 17:42:01 14
  • Return the creation date of a file on ext2, 3, 4 filesystems, because stat command won't show it. Useful on ubuntu, debian, and else Show Sample Output


    3
    debugfs -R "stat <$(stat --printf=%i filename)>" /dev/sdaX | grep crtime
    pggx999 · 2015-04-09 01:23:56 10
  • For slow flash memory (cheap thumb drive), ext4 is the fastest stable file system for all use cases with no relevant exception: http://www.linuxplanet.com/linuxplanet/tutorials/7208/1 Since we can usually dispense with the benefits of a journal for this type of storage, this is a way to achieve the least awful I/O-speed. Disabling the journal for an existing ext4 partition can be achieved using tune2fs -O ^has_journal /dev/sdXN Note that it is often recommended to format removable flash media with ext2, due to the lack of a journal. ext4 has many advantages over ext2 even without the journal, with much better speed as one of the consequences. So the only usecase for ext2 would be compatibility with very old software.


    2
    mke2fs -t ext4 -O ^has_journal /dev/sdXN
    michelsberg · 2013-02-15 17:24:02 6
  • XX is your device partition number like /dev/sdc1 . to see how many inodes your partition have type: df --inodes (or df -i) Default formatting with ext4 would create small inode count for the new partition if you need big count of inodes is the fstype news the correct one. in debian you can see which fstype exists as template in: vim /etc/mke2fs.conf if you format default ext for a partition size with 1TB you would get 1 Million inodes (not enough for backupStorages) but if you format with fstype news you would get hunderd of millions of inodes for the partition. you have tune /etc/sysctl.conf also with following sysconfig parameters fs.file-max = XXX fs.nr_open = XXX where XXX is the count of max inodes for whole system


    1
    mkfs.ext4 -T news /dev/sdcXX
    aysadk · 2019-07-02 13:31:23 37
  • Find out the earliest installation time of a linux system by getting the / filesystem creation time. This example is only valid the os is installed on an ext2/3/4 filesystem.


    0
    tune2fs -l $(df -P / | awk 'NR==2 {print $1}') | sed -n 's/^.*created: *//p'
    forcefsck · 2012-05-31 12:12:35 3

What's this?

commandlinefu.com 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

Virtualbox: setup hardware
where - memory 256 assign 256 Mb RAM - acpi on enable ACPI (mandatory if you use Winfog 2000 - ioapic off disable the IO APIC. Not useful if you use one CPU (on virtual machine or a 32 bit operative system). As ACPI, this switch is mandatory for Winbug 2000 - pae on enable the Phisical Address Extension how to use more than 4Gb of RAM on x86 CPU - hwvirtex on enables hardware virtualization extensions for microprocessors that have this feature (which should be also enabled in the BIOS of the motherboard) - nestedpaging on allows part of the processes of memory management hardware are made directly

look for a function reference in a library set

Find all files with colons and replace with underscores; current directory and below (recursive).

Rename files in batch

Install pip with Proxy
Installs pip packages defining a proxy

Command template, executing a command over multiple files, outputing progress and fails only
This is a command template for achiving the following: * loop over files --> find -name "" | while read file; do ...; done * output progress --> echo -n . * execute some command on each file and save output for later usage --> output=$() * if command failed, open subshell and echo newline --> || (echo;...;...;) * echo output of command --> echo "$output"

How to copy CD/DVD into hard disk (.iso)
A dear friend of mine asked me how do I copy a DVD to your hard drive? If you want to make a copy of the ISO image that was burned to a CD or DVD, insert that medium into your CD/DVD drive and (assuming /dev/cdrom is associated with your computer?s CD drive) type the following command

Pack up some files into a tarball on a remote server without writing to the local filesystem
I recently found myself with a filesystem I couldn't write to and a bunch of files I had to get the hell out of dodge, preferably not one at a time. This command makes it possible to pack a bunch of files into a single archive and write it to a remote server.

Get your outgoing IP address

Shows what an RPM was compiled with.
\n Separates out the architectures on different lines.


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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: