Jump to content

btrfs file system


duanester
 Share

Recommended Posts

btrfs is still experimental for ssd drives.

 

https://en.opensuse.org/openSUSE:Snapper_Tutorial

 

 

 

You may convert EXT3 & EXT4 filesystems to Btrfs to take advantage of Snapper. Using Snapper on EXT4 filesystem ishighly discouraged

 

Before even considering installing any form of linux, i had to be sure that i wouldn't cause the demise of my drives, read articles and documentation till i gotten a headache :lol:

 

https://en.opensuse.org/SDB:SSD_performance

 

 

 

Filesystems

The file systems which work best with SSD drives are BTRFS and EXT4. However, BTRFS is still experimental, so Ext4 is the safest choice.

 

Snapper is pretty attractive utility for restoring a borked system though it's highly discouraged utilizing it on ext4 :hammer:

 

Hence my reasoning in sticking with Tumbleweed hoping i'll be the first to run the convert command!

 

https://btrfs.wiki.kernel.org/index.php/Main_Page#Stability_status

 

 

 

The Btrfs code base is under heavy development. Not only is every effort being made to ensure that it remains stable and fast but to make it more so with each and every commit. This rapid pace of development means that the filesystem improves noticeably with every new Linux release so it's highly recommended that users run the most modern kernel possible.

 

 

Link to comment
Share on other sites

 

btrfs is still experimental for ssd drives.

don't think it is, think it's stable and is ssd aware, features implemented from your link

"SSD (flash storage) awareness (TRIM/Discard for reporting free blocks for reuse) and optimizations (e.g. avoiding unnecessary seek optimizations, sending writes in clusters, even if they are from unrelated files. This results in larger write operations and faster write throughput)"

 

Hence my reasoning in sticking with Tumbleweed hoping i'll be the first to run the convert command!

sorry duan i fail to see your logic here.

 

if you did a default install of tumbleweed or leap42 on a ssd drive(any type of drive) then you'll already be running the btrfs file system because that is now always the default file system for root.

if memory serves xfs is used for home.

 

personally i use ext4 for both root and home on my leap42 and tumbleweed installs, think nigel uses btrfs but with snapper turned off on whatever version he's running.

 

:b33r:

Edited by terry1966
Link to comment
Share on other sites

made some edit's to last post you may have missed, and to be honest duan i don't really see what rolling kernel updates has to do with using btrfs anyway.

 

like i said (or may have edited in) in last post by default both leap and tumbleweed use btrfs by default.

 

:b33r:

Link to comment
Share on other sites

hdparm -I /dev/sda | grep TRIM
           *    Data Set Management TRIM supported (limit unknown)

My samsung ssd drives support trim, block limits are unknown.

hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
        Model Number:       SAMSUNG MZ7PA128HMCD-010H1              
        Serial Number:      S0NSNEABB08823      
        Firmware Revision:  AXM07H1Q
        Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6
Standards:
        Used: ATA/ATAPI-7 T13 1532D revision 1 
        Supported: 8 7 6 5 & some of 8
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:   16514064
        LBA    user addressable sectors:  250069680
        LBA48  user addressable sectors:  250069680
        Logical/Physical Sector size:           512 bytes
        device size with M = 1024*1024:      122104 MBytes
        device size with M = 1000*1000:      128035 MBytes (128 GB)
        cache/buffer size  = unknown
        Nominal Media Rotation Rate: Solid State Device
Capabilities:
        LBA, IORDY(can be disabled)
        Queue depth: 32
        Standby timer values: spec'd by Standard, no device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 16
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4 
             Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
           *    SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    NOP cmd
           *    DOWNLOAD_MICROCODE
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
           *    General Purpose Logging feature set
           *    64-bit World wide name
           *    WRITE_UNCORRECTABLE_EXT command
           *    {READ,WRITE}_DMA_EXT_GPL commands
           *    Segmented DOWNLOAD_MICROCODE
           *    Gen1 signaling speed (1.5Gb/s)
           *    Gen2 signaling speed (3.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Phy event counters
           *    Host automatic Partial to Slumber transitions
           *    Device automatic Partial to Slumber transitions
           *    DMA Setup Auto-Activate optimization
                Device-initiated interface power management
           *    Software settings preservation
           *    SMART Command Transport (SCT) feature set
           *    SCT Write Same (AC2)
           *    SCT Error Recovery Control (AC3)
           *    SCT Features Control (AC4)
           *    SCT Data Tables (AC5)
           *    Data Set Management TRIM supported (limit unknown)
Security: 
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
                frozen
        not     expired: security count
                supported: enhanced erase
        6min for SECURITY ERASE UNIT. 6min for ENHANCED SECURITY ERASE UNIT. 
Logical Unit WWN Device Identifier: 50010f0000000000
        NAA             : 5
        IEEE OUI        : 0010f0
        Unique ID       : 000000000
Checksum: correct

Just stuff

fdisk -l
Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0003c09a

Device     Boot    Start       End   Sectors  Size Id Type
/dev/sda1           2048   4208639   4206592    2G 82 Linux swap / Solaris
/dev/sda2  *     4208640  46153727  41945088   20G 83 Linux
/dev/sda3       46153728 250068991 203915264 97.2G 83 Linux

df -h -T
Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs  989M  8.0K  989M   1% /dev
tmpfs          tmpfs     996M  140M  856M  15% /dev/shm
tmpfs          tmpfs     996M  2.3M  994M   1% /run
tmpfs          tmpfs     996M     0  996M   0% /sys/fs/cgroup
/dev/sda2      btrfs      21G  6.7G   14G  34% /
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/lib/mysql
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/lib/pgsql
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/cache
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/log
/dev/sda2      btrfs      21G  6.7G   14G  34% /opt
/dev/sda2      btrfs      21G  6.7G   14G  34% /boot/grub2/i386-pc
/dev/sda2      btrfs      21G  6.7G   14G  34% /usr/local
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/spool
/dev/sda2      btrfs      21G  6.7G   14G  34% /.snapshots
/dev/sda2      btrfs      21G  6.7G   14G  34% /boot/grub2/x86_64-efi
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/opt
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/lib/named
/dev/sda2      btrfs      21G  6.7G   14G  34% /tmp
/dev/sda2      btrfs      21G  6.7G   14G  34% /srv
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/crash
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/lib/libvirt/images
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/lib/mailman
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/lib/mariadb
/dev/sda3      btrfs      98G  684M   96G   1% /home
/dev/sda2      btrfs      21G  6.7G   14G  34% /var/tmp
tmpfs          tmpfs     200M     0  200M   0% /run/user/475
tmpfs          tmpfs     200M  8.0K  200M   1% /run/user/1000

lsblk -f
NAME   FSTYPE LABEL UUID                                 MOUNTPOINT
sda                                                      
├─sda1 swap         465fc9a3-5ab8-4421-9382-a1b0d0b42ed6 [SWAP]
├─sda2 btrfs        b8cb6da2-184e-4d3a-9487-8919084a84ba /var/tmp
└─sda3 btrfs        e521d5e0-b6d5-41a9-a37a-5ab88ea8c169 /home
sr0                                            

finally you can see btrfs

Link to comment
Share on other sites

I'm running BTRFS on my SSD and Ext4 on my storage hard drives. The only issue I ran into was snapper itself constantly causing crashes. Disabled snapper and now no issues at all.

Snapper for what ever reason isn't giving any problems yet though ocd is kicking in after i noticed snapper being fully customize able, Learning, I'll get some :P

Link to comment
Share on other sites

not sure if the problem is still there with snapper, but it used to create so many backup images it used up all the root hard drive and eventually the system failed to boot, what's more the images didn't show up as used space so was hard to diagnose the problem if memory serves and that was why nigel disabled it, think the work around was to set a limit of 5 or something.

 

no idea if they fixed the problem or not though because i don't use btrfs or snapper.

 

:b33r:

Link to comment
Share on other sites

So i can delete and create, easy peasy, i got as far adding /home to Config! root snapshots are a default setting :facepalm:

 

trying to figure how setting max # snapshots :huh:

 

You can easily delete snapshots from within Yast > Snapper or from terminal:

snapper -c root list

This will give a list of snapshots

 

and to delete:

snapper -c root delete #

# being the snapshot number to delete.

 

You can also amend the config file for snapper to restrict the number of snapshots, timings etc or you can just disable it completely :

 

https://www.suse.com/documentation/sles-12/book_sle_admin/data/sec_snapper_config.html

Link to comment
Share on other sites

Add a line?


# subvolume to snapshot
SUBVOLUME="/"

# filesystem type
FSTYPE="btrfs"

/etc/snapper/configs/
# btrfs qgroup for space aware cleanup algorithms
QGROUP="1/0"


# fraction of the filesystems space the snapshots may use
SPACE_LIMIT="0.5"


# users and groups allowed to work with config
ALLOW_USERS=""
ALLOW_GROUPS=""

# sync users and groups from ALLOW_USERS and ALLOW_GROUPS to .snapshots
# directory
SYNC_ACL="no"


# start comparing pre- and post-snapshot in background after creating
# post-snapshot
BACKGROUND_COMPARISON="yes"


# run daily number cleanup
NUMBER_CLEANUP="yes"

# limit for number cleanup
NUMBER_MIN_AGE="1800"
NUMBER_LIMIT="2-10"
NUMBER_LIMIT_IMPORTANT="4-10"


# create hourly snapshots
TIMELINE_CREATE="no"

# cleanup hourly snapshots after some time
TIMELINE_CLEANUP="yes"

# limits for timeline cleanup
TIMELINE_MIN_AGE="1800"/etc/snapper/configs/
TIMELINE_LIMIT_HOURLY="10"
TIMELINE_LIMIT_DAILY="10"
TIMELINE_LIMIT_WEEKLY="0"
TIMELINE_LIMIT_MONTHLY="10"
TIMELINE_LIMIT_YEARLY="10"


# cleanup empty pre-post-pairs
EMPTY_PRE_POST_CLEANUP="yes"

# limits for empty pre-post-pair cleanup
EMPTY_PRE_POST_MIN_AGE="1800"


Seems as if the system will keep things under control with current settings.

 

edit: this line must be the limit

# fraction of the filesystems space the snapshots may use
SPACE_LIMIT="0.5"
Edited by duanester
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...