From: Sylvain Alain <sylalain@videotron.ca>
To: linux-btrfs@vger.kernel.org
Subject: [Validation] How to properly use the subvolume and snapshot for a backup method
Date: Tue, 24 May 2011 23:49:21 -0400 [thread overview]
Message-ID: <4DDC7C41.20908@videotron.ca> (raw)
Hi everyone, first of all, I want to say that I'm learning how to use
BTRFS and I really enjoy all the subvolume and the snapshot features.
Also, I'm a backup freak :P
Basically, I have 4 questions :
1. I would like to know what is the best way to install a Linux
distribution inside a BTRFS partition ? I mean, do I install it directly
inside the subvolid=0 or I create a subvolume for exemple @root to leave
the subvolid=0 clean and without any data, of course only subvolume and
then I install my distro inside the @root subvolume ? I'm asking that,
because I saw that Ubuntu 11.04 use the subvolume @ and @home to install
the distribution files so, the subvolid=0 is clean.
I saw that because at boot time, the /boot/grub/grub.cfg use this param
with Grub2 : rootflags=subvol=@
2. I would like to know if this Live backup method is correct ?
+++++
My /dev/sda2 contains a @root subvolume that contains my distribution,
my /home directory is inside an another subvolume that is at the same
level that @root.
# mkdir /mnt/disklayout
# mount /dev/sda2 /mnt/disklayout -o subvolid=0
# cd /mnt/disklayout
# btrfs subvolume snapshot @root snapshot-@racine-live
# btrfs subvolume snapshot @home snapshot-@home-live
# mount /dev/sdb1 /mnt/backup -o subvol=@backup
# time rsync -aHA --del --force --stats --progress
snapshot-@racine-live/ /mnt/backup/funtoo
# time rsync -aHA --del --force --stats --progress snapshot-@home-live/
/mnt/backup/funtoo/home
# time rsync -aHA --del --force --stats --progress /boot/
/mnt/backup/funtoo/boot
# cd /mnt/disklayout
# btrfs subvolume delete snapshot-@root-live
# btrfs subvolume delete snapshot-@home-live
# cd /
# umount /mnt/disklayout
Creation of the snapshot :
# cd /
# umount /mnt/backup
# mount /dev/sdb1 /mnt/backup -o subvolid=0
# cd /mnt/backup
# btrfs subvolume snapshot @backup @snap-20110502
# btrfs subvolume list .
# cd /mnt/backup
# ls -la
# cd @snap-20110502
# ls -la
# cd /
# umount /mnt/backup
------
3. Is there any objection to use a snapshot name or a subvolume that
start with a @ ?
4. Finally,I would like to know if we can rename subvolume ?
The best example is this : I crash my box but I made earlier a snapshot
that is named @snap-20110502 inside my subvolid=0. Now that my @root is
brain dead, I would like to delete it and rename the @snap-20110502 to
@root ?
Is this possible and if so, can I use the mv command or something else ?
I'm sure that I will need to boot with a LiveCD to do so, but for the
rest, is this possible ?
Thanks you very much !!!
--
Salut
alp
Sylvain
next reply other threads:[~2011-05-25 3:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-25 3:49 Sylvain Alain [this message]
2011-05-25 17:34 ` [Validation] How to properly use the subvolume and snapshot for a backup method Goffredo Baroncelli
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=4DDC7C41.20908@videotron.ca \
--to=sylalain@videotron.ca \
--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.