suaefar / ryzen-test

Tools to reproduce randomly crashing processes under load on AMD Ryzen processors on Linux
GNU General Public License v3.0
224 stars 59 forks source link

Make ext4 filesystem explicitly on zram device #13

Closed damentz closed 7 years ago

damentz commented 7 years ago

The command 'mke2fs' can have different results depending on the configuration of /etc/mke2fs.conf. If an ext2 or ext3 filesystem is created, mount with "-o discard" will fail.

Use standard mkfs.ext4 command available on all distributions to eliminate potential variation in resulting filesystem.

Per Arch's wiki, ext4 supports continuous fstrim while ext3 does not: https://wiki.archlinux.org/index.php/Solid_State_Drives#TRIM

Closes suaefar/ryzen-test#11

damentz commented 7 years ago

@suaefar you're correct, discard is supported on zram. After some local testing, the default settings on Debian prefer to make a featureless ext2 filesystem with mke2fs versus ext4, or whichever filesystem / feature set is picked on Ubuntu.

Specifically, this is in my /etc/mke2fs.conf file:

[defaults]
        base_features = sparse_super,large_file,filetype,resize_inode,dir_index,ext_attr
        default_mntopts = acl,user_xattr
        enable_periodic_fsck = 0
        blocksize = 4096
        inode_size = 256
        inode_ratio = 16384

[fs_types]
        ext3 = {
                features = has_journal
        }
        ext4 = {
                features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize
                inode_size = 256
        }

Unless your script depends on the exact mount options you picked, I feel that this change is sufficient. Otherwise we can look at which exact feature we need to explicitly add for discard to work properly across multiple distributions.

suaefar commented 7 years ago

Okay, thank you.