All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Skwar <alexanders.mailinglists+nospam@gmail.com>
To: Kai Krakow <hurikhan77+btrfs@gmail.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Creating recursive snapshots for all filesystems
Date: Sun, 5 May 2013 14:59:40 +0200	[thread overview]
Message-ID: <CADn-QaNEdWiyKaniOhzAmaGb6p=PuZ4=FxPPPiVLZZJ3zB7xpQ@mail.gmail.com> (raw)
In-Reply-To: <h1rh5a-1lg.ln1@hurikhan.ath.cx>

Hello

On Sun, May 5, 2013 at 1:05 PM, Kai Krakow <hurikhan77+btrfs@gmail.com> wrote:
> Alexander Skwar <alexanders.mailinglists+nospam@gmail.com> schrieb:
>
>> Where I'm hanging right now, is that I can't seem to figure out a
>> "bullet proof" way to find all the subvolumes of the filesystems I
>> might have.
>
> What about this:
>
> # btrfs sub list -a /

How do I know that "/" is a btrfs? How do I know, that there are not
also other btrfs filesystems? :)

> You still need to iterate through the mounted btrfs filesystems if you are
> using more than one:
>
> # btrfs fi show | fgrep uuid
> Label: 'usb-backup'  uuid: 7038c8fa-4293-49e9-b493-a9c46e5663ca
> Label: 'system'  uuid: d2bb232a-2e8f-4951-8bcc-97e237f1b536
>
> Then translate the uuid back to an fspath somehow.

Yep. That's basically what I'm doing ATM.

>
> Another option would be to use blkid:
>
> # blkid -t TYPE=btrfs

Ah, that's cool! Didn't know that blkid had this option.

> Still needs translation back to fspathes. But that could be done with
> grep/head/lsblk trickery...

Hm, I didn't know lsblk until now, but it seems that it doesn't handle
LVM well, does it?

(See http://pastebin.com/fuZ8HHQi for better readable version.)

a@ask-home:~$ blkid -t TYPE=btrfs | grep mapper
/dev/mapper/ssd-Data: LABEL="Data"
UUID="7d2eb10f-aced-4d41-bb7f-7badbf075b6a"
UUID_SUB="582b64f5-edd5-48f2-978e-24df9a839b5b" TYPE="btrfs"

a@ask-home:~$ lsblk
NAME                      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                         8:0    0 167.7G  0 disk
├─sda1                      8:1    0   100M  0 part
├─sda2                      8:2    0  10.9G  0 part /dell-recovery
├─sda3                      8:3    0  39.1G  0 part /windows
├─sda4                      8:4    0     1K  0 part
├─sda5                      8:5    0   102M  0 part /boot
├─sda6                      8:6    0   8.1G  0 part [SWAP]
├─sda7                      8:7    0  12.2G  0 part
│ ├─ssd-Data (dm-0)       252:0    0    35G  0 lvm
│ └─ssd-UbRoot1304 (dm-1) 252:1    0    10G  0 lvm  /
├─sda8                      8:8    0  12.2G  0 part
│ └─ssd-Data (dm-0)       252:0    0    35G  0 lvm
├─sda9                      8:9    0  12.2G  0 part
│ └─ssd-Data (dm-0)       252:0    0    35G  0 lvm
├─sda10                     8:10   0  12.2G  0 part
│ └─ssd-Data (dm-0)       252:0    0    35G  0 lvm
├─sda11                     8:11   0  11.9G  0 part
├─sda12                     8:12   0  11.9G  0 part /data/Kernel/KernExt4
├─sda13                     8:13   0  11.9G  0 part
├─sda14                     8:14   0  11.9G  0 part /data/Kernel/KernReiserfs
└─sda15                     8:15   0  11.9G  0 part /data/Kernel/KernXfs
sr0                        11:0    1  1024M  0 rom

a@ask-home:~$ lsblk -P|grep Data
NAME="ssd-Data (dm-0)" MAJ:MIN="252:0" RM="0" SIZE="35G" RO="0"
TYPE="lvm" MOUNTPOINT=""
NAME="ssd-Data (dm-0)" MAJ:MIN="252:0" RM="0" SIZE="35G" RO="0"
TYPE="lvm" MOUNTPOINT=""
NAME="ssd-Data (dm-0)" MAJ:MIN="252:0" RM="0" SIZE="35G" RO="0"
TYPE="lvm" MOUNTPOINT=""
NAME="ssd-Data (dm-0)" MAJ:MIN="252:0" RM="0" SIZE="35G" RO="0"
TYPE="lvm" MOUNTPOINT=""


So I guess I'd still need to mount the root volume temporarily
somewhere to do the translation.

ZFS really wipes the floor with btrfs regarding ease of use as far as
that's concerned…

That blkid trick was quite useful, though. Thanks!

Cheers,
Alexander
-- 
=>        Google+ => http://plus.skwar.me         <==
=> Chat (Jabber/Google Talk) => a.skwar@gmail.com <==

  reply	other threads:[~2013-05-05 13:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02 20:41 Creating recursive snapshots for all filesystems Alexander Skwar
2013-05-03  8:48 ` Sander
2013-05-03 11:46   ` Alexander Skwar
2013-05-05 11:05 ` Kai Krakow
2013-05-05 12:59   ` Alexander Skwar [this message]
2013-05-05 16:03     ` Kai Krakow
2013-05-05 16:19       ` Alexander Skwar
2013-05-09 20:41     ` nocow 'C' flag ignored after balance Kyle Gates
2013-05-10  5:15       ` Liu Bo
2013-05-10 13:58         ` Kyle Gates
2013-05-16 19:11           ` Kyle Gates
2013-05-17  7:04             ` Liu Bo
2013-05-17 14:38               ` Kyle Gates
2013-05-28 14:22               ` Kyle Gates
2013-05-29  1:55                 ` Liu Bo
2013-05-29  8:33                   ` Miao Xie
2013-05-30 16:40                     ` Kyle Gates
2013-05-30 16:40                   ` Kyle Gates

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADn-QaNEdWiyKaniOhzAmaGb6p=PuZ4=FxPPPiVLZZJ3zB7xpQ@mail.gmail.com' \
    --to=alexanders.mailinglists+nospam@gmail.com \
    --cc=hurikhan77+btrfs@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.