Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of BTRFS File system Management in oracle

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail the example analysis of BTRFS file system management in oracle. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Introduction to btrfs file system

Btrfs (usually pronounced Butter FS), the file system expands to meet the scalability needs of large storage subsystems. The copy-on-write file system, announced and in progress by Oracle in 2007, aims to replace the defects of linux's current ext3/4 file system.

Features:

● creates a readable and writable snapshot that can be rolled back to the previous state of the file system.

● supports seamless upgrade from ext3/4 to btrfs and downgrade back to ext3/4

● supports data integrity check.

● uses transparent compression technology to save disk space

● uses defragmentation to improve performance

● supports disk arrays such as riad0,raid1,raid5,raid10.

Btrfs does not support swap

Create

You can deploy one or more pieces of a device using the command set that comes with mkfs or btrfs.

Common command

Command

Function

Mkfs.btrfs block_device

Create a single btrfs file system; for example

Mkfs.btrfs / dev/sdb1

Mkfs.btrfs-L label block_device

Create a volume label and use label to mount the file system

Mkfs.btrfs-L myvolume / dev/sdb2

Mkfs.btrfs-m single block_device

Create an btrfs file system on a device without replicating metadata; for example

Mkfs.btrfs-m single / dev/sdc

Mkfs.btrfs block_device1 block_device2...

Metadata is stored on multiple devices

Mkfs.btrfs / dev/sdd / dev/sde

Mkfs.btrfs

-m raid0 block_device1 block_device2...

Striped data is saved on multi-block devices (raid0)

Mkfs.btrfs-m raid0 / dev/sdd / dev/sde

Mkfs.btrfs

-d raid1 block_device1 block_device2

Mirror data on the relevant device (raid1)

Mkfs.btrfs-d raid1 / dev/sdd / dev/sde

Mkfs.btrfs-d raid10-m

Raid10 block_device1block_device2 block_device3 block_device4

Create a raid10 with at least four devices

Mkfs.btrfs-d raid10-m raid10 / dev/sdf\

/ dev/sdg / dev/sdh / dev/sdi / dev/sdj / dev/sdk

# mkfs.btrfs-m single / dev/sdb / * create

Btrfs v3.16.2

See http://btrfs.wiki.kernel.org for more information.

Turning ON incompat feature 'extref': increased hardlink limit per file to 65536

Fs created label (null) on / dev/sdb

Nodesize 16384 leafsize 16384 sectorsize 4096 size 20.00GiB

# mount / dev/sdb / my-btrfs-mountpoint / * Mount. The mount directory exists first.

# echo "UUID='b7175cc5-2b21-4c73-827f-791d00e77658'/ my-btrfs-mountpoint btrfs defaults 00" > > / etc/fstab / / Auto-mount on boot

View btrfs related information

The btrfs filesystem df view is more accurate than the df command that comes with linux.

# btrfs filesystem df / my-btrfs-mountpoint

Data, single: total=8.00MiB, used=64.00KiB

System, single: total=4.00MiB, used=16.00KiB

Metadata, single: total=264.00MiB, used=112.00KiB

GlobalReserve, single: total=16.00MiB, used=0.00

Display all btrfs file system information

# btrfs filesystem show

Label: none uuid: a0518a90-7c44-497b-8d57-1c40af672fab

Total devices 1 FS bytes used 192.00KiB

Devid 1 size 20.00GiB used 276.00MiB path / dev/sdb

Btrfs v3.16.2

Expand or shrink

Common command

Btrfs device add devicemountpoint

Capacity expansion: add a new piece of equipment

Btrfs device add / dev/sdd / my-btrfs-mountpoint

Btrfs device delete device

Delete: delete an existing device (data capacity planning should be made before deletion)

Btrfs device delete / dev/sdd / my-btrfs-mountpoint

Btrfs filesystem balance mountpoint

After a new device is added or removed, refresh the file system to reassign data to available devices.

Compress to improve the performance of Ihamo

# btrfs filesystem defragment / my-btrfs-mountpoint / * organize the file system

# btrfs filesystem autodefrag / my-btrfs-mountpoint / * not recommended for large databases

Resize the file system

# btrfs filesystem resize + 2g / my-btrfs-mountpoint / * add 2G space

Resize'/ my-btrfs-mountpoint' of'+ 2g'

# btrfs filesystem resize-2g / my-btrfs-mountpoint / * reduce 2G space

Resize'/ my-btrfs-mountpoint' of'- 2g'

# btrfs filesystem resize 20g / my-btrfs-mountpoint / * set the space size to 20g

Resize'/ my-btrfs-mountpoint' of '20g'

Create a snapshot

# Snapshots must be in their subfile system directory

# btrfs subvolume snapshot / my-btrfs-mountpoint/ / my-btrfs-mountpoint/snapshot1 / * create a snapshot

Create a snapshot of'/ my-btrfs-mountpoint/' in'/ my-btrfs-mountpoint/snapshot1'

# btrfs subvolume list / my-btrfs-mountpoint / * View Snapshot

ID 257 gen 12 top level 5 path snapshot1

# btrfs subvolume delete / my-btrfs-mountpoint/snapshot1 / * Delete a snapshot

Transaction commit: none (default)

Delete subvolume'/ my-btrfs-mountpoint/snapshot1'

Replace broken equipment

# btrfs replace start / dev/sdc / dev/sde-r / my-btrfs-mountpoint / * / dev/sdc already faulty device, / dev/sde new device / my-btrfs-mountpoint file system mount point

# btrfs replace status-1 / my-btrfs-mountpoint / * View the status after replacement

Started on 29.Aug 14:49:22, finished on 29.Aug 14:49:22, 0 write errs, 0 uncorr. Read errs

This is the end of this article on "sample analysis of BTRFS file system management in oracle". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report