Skip to main content
60 votes

How to extend an ext4 partition and filesystem?

Using growpart and resize2fs example: Do note the space betwen /dev/sda and 1 in the case of growpart /dev/sda 1: These are the two commands: growpart /dev/sda 1 resize2fs /dev/sda1 $ growpart /...
Chris Stryczynski's user avatar
41 votes

Is it possible to on-line shrink a EXT4 volume with LVM?

If the case is remote server without console, you can shrink filesystem using initramfs while rebooting. You need to add resize2fs to initramfs and run it before mounting root. Debian/Ubuntu example: /...
urusha's user avatar
  • 539
37 votes

Ext4 vs. XFS vs. Btrfs vs. ZFS for NAS

I generally use one of the following two filesystems: XFS for anything which does not play well with CoW (or for virtual machines whose datastore already is on a CoW filesystem) or when extremely ...
shodanshok's user avatar
  • 51.1k
18 votes
Accepted

Is there a way to protect SSD from corruption due to power loss?

When suddenly losing power, MLC/TLC/QLC SSDs have two failure modes: they lose the in-flight and in-DRAM-only writes; they can corrupt any data-at-rest stored in the lower page of the NAND cell being ...
shodanshok's user avatar
  • 51.1k
14 votes

ext4: Running out of inodes

Is there a way to solve this without creating and copying to a new partition Nope, the number of inodes is fixed when the filesystem is created as the man page says Be warned that it is not ...
user9517's user avatar
  • 116k
13 votes

How to extend an ext4 partition and filesystem?

Note, on some VDS servers you could have non-primary root partition and need to resize Extended partition container first For example, you've just upgraded your plan and have something like: Disk /...
user394639's user avatar
12 votes

Ext4 usage and performance

Sounds like you're running SSDs, which can have some funky performance characteristics as they get full. The fact that when the usage dropped around 6/1, performance didn't go back to normal, ...
womble's user avatar
  • 97.3k
11 votes

How to clean up an unprocessed orphan inode list?

e2fsck -f <mount point> won't work. First find out the mount points with sudo mount -l Then fsck the drive directly. For example for me sudo e2fsck -f /dev/xvda2
Ganesh Krishnan's user avatar
11 votes

Is there a way to protect SSD from corruption due to power loss?

Yeah. Don't get super cheap SSD - anything outside the low end consumer market has capacitators and full protection against power loss. Amd really does not cost that much more.
TomTom's user avatar
  • 52k
11 votes

Options for performance improvements on very big Filesystems and high IOWAIT

I have a similar (albeit smaller) setup, with 12x 2TB disks in a RAID6 array, used for the very same purpose (rsnapshot backup server). First, it is perfectly normal for du -hs to take so much time ...
shodanshok's user avatar
  • 51.1k
11 votes
Accepted

Linux/ext4/sqlite: Can touching a file while it's being written to cause a race condition?

You can indeed touch an open file without corrupting its content, as the filesystem will serialize updates to inode metadata. If this is safe from an application point of view is another matter ...
shodanshok's user avatar
  • 51.1k
10 votes

Why can I change the the reserved blocks on a read only mounted ext4 filesystem?

tune2fs never needed the filesystem to be mounted to operate. As you can see in the command, you pass a block device node (/dev/sdh) as an argument to it, not a mountpoint (/mnt/disk/005). It's ...
Tom Yan's user avatar
  • 993
9 votes

How to delete millions of files without disturbing the server

Make a bash script like this: #!/bin/bash rm -- "$*" sleep 0.5 Save it with name deleter.sh for example. Run chmod u+x deleter.sh to make it executable. This script deletes all files passed to it ...
Tero Kilkanen's user avatar
9 votes

Ubuntu server ext4 hitting 65000 subdirectory limit

Ext4 directory limit Ext4 supports two kinds of directories: traditional almost-linear directories hash-based directories Linear directories have a limit of 65000 links, i.e. around that many ...
Georg Schölly's user avatar
8 votes

Ext4 vs. XFS vs. Btrfs vs. ZFS for NAS

This looks more like a question for superuser than for serverfault, but some of the ideas are valid for this site too, so I'll take a stab at answering some of the questions: XFS has had a reputation ...
Mikael H's user avatar
  • 5,139
7 votes

Is there a way to protect SSD from corruption due to power loss?

The first thing to do is to define recovery time and recovery point objectives. How long do you have to recover one of these terminals, and what data point in time is acceptable? Perhaps within a ...
John Mahowald's user avatar
7 votes

How to write a sparse Linux (EXT4) disk image without writing gigabytes of zeros?

dd can handle this. You need to add conv=sparse to the command line. From the man page: try to seek rather than write the output for NUL input blocks
Michael Hampton's user avatar
7 votes

Ext4 vs. XFS vs. Btrfs vs. ZFS for NAS

I would use whatever journalling file system the operating system in question suggested as default unless I had very good reason not to. Last time I checked with Ubuntu that was ext4. The reason is ...
Thorbjørn Ravn Andersen's user avatar
7 votes
Accepted

mkfs.ext4 error with option -O ^64bit

Just do not try to manually disable (^) the feature, then. You already are trying to create a volume exceeding what is possible without it. Adding ability for the file system to be larger than 16TiB (...
anx's user avatar
  • 9,912
6 votes

Rsync size is difference from source to destination

Ran into this "problem" when using 'du -b -d0 source destination' as I had a huge list of things not match as I drilled down. The problem seemed to be is that du insists on reporting the disk usage ...
marinara's user avatar
  • 169
6 votes

How to extend an ext4 partition and filesystem?

The accepted answer is somewhat outdated: resizing an ext4 filesystem is better done online rather than offline, as the online expansion code path is much more commonly used than the offline one. The ...
shodanshok's user avatar
  • 51.1k
6 votes
Accepted

Linux no modify time (nomtime)

There is no such option in the kernel. include/linux/statfs.h: #define ST_NOATIME 0x0400 /* do not update access times */ #define ST_NODIRATIME 0x0800 /* do not update directory access times */...
Joshua Griffiths's user avatar
6 votes
Accepted

LVM cache in writeback mode is equivalent to external ext4 journal?

An external journal isn't the same thing as an LVM cache device at all. An LVM cache on an SSD for writeback wouldn't be volatile, so the concerns with data integrity aren't enormous (except for if ...
Spooler's user avatar
  • 7,136
6 votes
Accepted

Recover the file system from a corrupted RAID1

You can use a loop mount to mount a partition in your disk image as a device. When creating the loop device, you give an offset which makes the loop device begin at that spot in the partition. This ...
Tero Kilkanen's user avatar
6 votes
Accepted

How to pass multiple options to `tune2fs -E mount_opts`?

As Thomas says, sparated by commas is for extended option separation. However, mount_opts option separation is also done using , (see Linux kernel fs/ext4/super.c:parse_options()), and as of this ...
ElementW's user avatar
  • 176
6 votes
Accepted

Partitioning - Is 5% reserved blocks required/recommended?

On ext* based filesystems, the reserved space is used to guarantee privileged processes (ie: syslog) some more space to use. Without this reservation (and not using quotas) an user-level process can ...
shodanshok's user avatar
  • 51.1k
6 votes

Options for performance improvements on very big Filesystems and high IOWAIT

This Filesystem stores a huge amount of small files with very many SEEK operations but low IO throughput. 🎉 This is thing that catches lots of people nowadays. Alas, conventional FSes do not scale ...
poige's user avatar
  • 9,605
6 votes

Print unused bytes of logical volume

The default size of the entire block device, plus online growth, makes the size check unnecessary. Run resize2fs on all of your file systems. (If you have a use case that requires the size, please ...
John Mahowald's user avatar
5 votes

How can I compact the VHD file with Ubuntu?

I can confirm: zerofree is working to compact virtual disk files BUT: you don't need to use any rescue CDs or to mount the VHDX in another virtual machine: sudo apt-get install zerofree Boot into ...
Jochen's user avatar
  • 169
5 votes
Accepted

Can't mount SATA drives when moved from USB enclosure to internal

This sounds like the problem described at https://superuser.com/questions/679725/how-to-correct-512-byte-sector-mbr-on-a-4096-byte-sector-disk: the USB enclosures reported a different sector size than ...
oliver's user avatar
  • 405

Only top scored, non community-wiki answers of a minimum length are eligible