btrfsがサブボリュームに対して混乱している

btrfsがサブボリュームに対して混乱している

組み込みLinuxシステムでbtrfsの使用を開始しました。私のシステムには現在rfs用のSDカードがあります。

私が望むのは、システムファイル(現在/下)とホームディレクトリ(/homeの下)のスナップショットを撮る方法です。これを行う方法として、サブボリューム/mnt/rootと/mnt/homeを作成しますか?サブボリュームを作成したら、現在の/および/homeの下にあるすべてのファイルを新しいサブボリュームにコピーしてファイルを埋め、元のファイルを削除しますか?それとも、ソースデータのスナップショットで新しいサブボリュームを埋める方が良いですか?

その後、起動時にこれらの新しいサブボリュームをマウントしたいのですが、どうすればよいかわかりません。

ベストアンサー1

btrfs subvolume snapshotこれを行うコマンドがあります。これにより、新しいサブボリュームがソースファイルへのCOW参照で埋められます。/(通常は@:)と/home(通常は:)にマウントされているサブボリュームは@home別々のサブボリュームであるため、このコマンドを両方のボリュームに適用する必要があります。

usage: btrfs subvolume snapshot [-r] <source> <dest>|[<dest>/]<name>

    btrfs subvolume snapshot [-r] [-i <qgroupid>] <source> <dest>|[<dest>/]<name>

    Create a snapshot of the subvolume
    Create a writable/readonly snapshot of the subvolume <source> with
    the name <name> in the <dest> directory.  If only <dest> is given,
    the subvolume will be named the basename of <source>.

    -r             create a readonly snapshot
    -i <qgroupid>  add the newly created snapshot to a qgroup. This
                   option can be given multiple times.

おすすめ記事