Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 4th November 2011, 02:27 AM
Timberbrook Offline
Registered User
 
Join Date: Dec 2010
Posts: 24
linuxfirefox
BTRFS Subvolume of Home?

Hey guys, I've been trying out BTRFS the last couple days, just to kind of see what to expect and what I can do with it once its finalized and we have a working fsck. I do have a couple question that neither the Arch Wiki, The Fedora WIki, Ubuntu wiki or the kernel.org wiki could answer. So here goes;


When I installed fedora (F16 Beta) I made root be an ext4 partition, with /home as BTRFS. (Side question; seriously, why cant Anaconda install as non-ext4 root? No other installer mandates the root partition be the same type as the liveCD). Ubuntu wiki states that any BTRFS partition has a default subvolume called "default," I cant find it for /home.

/etc/fstab:

#
# /etc/fstab
# Created by anaconda on Thu Nov 3 15:24:14 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=e5021a48-c961-4e73-98a5-beee06355f46 / ext4 defaults 1 1
UUID=97ac420f-2818-4833-b7b6-4ac497716e3b /home btrfs defaults,autodefrag,compress 1 2
UUID=0d275462-1ad3-46af-a1b8-637ca5efeca6 swap swap defaults 0 0


btrfs --help says. "btrfs subvolume list <path> : List the snapshot/subvolume of a filesystem." I'd expect it to spit out "default" at some point.

Couple outputs

[eric@eric-laptop ~]$ sudo btrfs subvolume list /
ERROR: '/' is not a subvolume
[eric@eric-laptop ~]$ sudo btrfs subvolume list /home
[eric@eric-laptop ~]$

What i wanted was an easy; reliable way to keep a backup of my home using btrfs instead of just rsync. Unfortunately, in order to use snapshot, it needs to be on, or be a, subvolume.

proof:

[eric@eric-laptop ~]$ sudo btrfs subvolume snapshot /home/eric /home/eric/test
ERROR: '/home/eric' is not a subvolume
[eric@eric-laptop ~]$

So; I rebooted into single user, mv'ed /home/eric to /home/eric-btrfs, made a subvolume in /home/ named 'eric' to take the place of my home, and cp'ed all of my files from eric-btrfs to eric, a quick chown, and chmod to get the file permissions right.

Rebooted, tried to login... error messages, lots of error messages. "Cant switch out from /" "/home/eric/.kde/share/config/knotifyrc is not writable" despite having read and write permission, and ownership.

Can anyone figure out what the heck is going on? I know BTRFS is still experimental, but I thought the layout and implementation was finalized. OR; what do I have to do to make Btrfs work as a /home as it should? (see ZFS / LVM )
Reply With Quote
  #2  
Old 4th November 2011, 10:58 PM
Timberbrook Offline
Registered User
 
Join Date: Dec 2010
Posts: 24
windows_7firefox
Re: BTRFS Subvolume of Home?

Anyone got ideas? I really want to have this worked out before F16 officially launches
Reply With Quote
  #3  
Old 5th November 2011, 02:51 AM
chrismurphy Offline
Registered User
 
Join Date: May 2010
Posts: 880
macoschrome
Re: BTRFS Subvolume of Home?

Quote:
Originally Posted by Timberbrook View Post
(Side question; seriously, why cant Anaconda install as non-ext4 root? No other installer mandates the root partition be the same type as the liveCD).
Pretty sure Fedora installer uses dd to write a root image to your root directory and that image is ext4. That's why the installation is super fast compared to the DVD installer. Then it simply resizes that lv postinstall. You can convert that ext4 to btrfs, I'm pretty sure the commands are included by default.

Last edited by chrismurphy; 5th November 2011 at 07:37 AM.
Reply With Quote
  #4  
Old 5th November 2011, 03:25 AM
Timberbrook Offline
Registered User
 
Join Date: Dec 2010
Posts: 24
windows_7firefox
Re: BTRFS Subvolume of Home?

Thanks for the reply Chris, atleast that explains Anaconda. But what does converting ext4 to btrfs get me? Its still not listing the 'default' subvolume thats supposed to exist so I can't do snapshots. Like this seems to be a pretty massive hole in the entire idea behind BTRFS' backups, if it doesnt create a default subvolume considering you need a subvolume to use snapshots.
Reply With Quote
  #5  
Old 5th November 2011, 07:42 AM
chrismurphy Offline
Registered User
 
Join Date: May 2010
Posts: 880
macoschrome
Re: BTRFS Subvolume of Home?

My understanding is that if you convert ext4 to btrfs, the original ext4 is a snapshot and everything else is btrfs. You might need to join one of the btrfs mailing lists and post some inquiries there. The dev list doesn't get insane amount of traffic so if you've read all the btrfs wiki stuff and have done at least some basic searches of the btrfs mailing list for keywords related to your question, I think you'd find some people who'd answer concise questions on that list.
Reply With Quote
  #6  
Old 6th November 2011, 01:20 PM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,346
linuxfedorafirefox
Re: BTRFS Subvolume of Home?

Quote:
Originally Posted by Timberbrook View Post
Hey guys, I've been trying out BTRFS the last couple days, just to kind of see what to expect and what I can do with it once its finalized and we have a working fsck. I do have a couple question that neither the Arch Wiki, The Fedora WIki, Ubuntu wiki or the kernel.org wiki could answer. So here goes;
...
Ubuntu wiki states that any BTRFS partition has a default subvolume called "default," I cant find it for /home.
...

btrfs --help says. "btrfs subvolume list <path> : List the snapshot/subvolume of a filesystem." I'd expect it to spit out "default" at some point.

Couple outputs

[eric@eric-laptop ~]$ sudo btrfs subvolume list /
ERROR: '/' is not a subvolume
[eric@eric-laptop ~]$ sudo btrfs subvolume list /home
[eric@eric-laptop ~]$
I *think* the Ubuntu doc was implying there is always the root tree on the btrfs volume in addition to any subvolumes.
Code:
[root@hypoxylon ~]# mount -t btrfs /dev/sda6 /media/mp
[root@hypoxylon ~]# btrfs sub list  /media/mp
ID 256 top level 5 path newhome/stevea/SV-stevea
ID 257 top level 5 path newhome/testuser/SV-testuser
[root@hypoxylon ~]# mount -t btrfs -o subvolid=256 /dev/sda6 /media/mp1
[root@hypoxylon ~]# ls -l /media/mp1
total 0
-rw-r--r-- 1 root root 0 Nov  5 00:58 sv-s-bar
-rw-r--r-- 1 root root 0 Nov  5 00:58 sv-s-bletch
-rw-r--r-- 1 root root 0 Nov  5 00:58 sv-s-foo
[root@hypoxylon ~]# ls -l /media/mp/newhome/stevea/SV-stevea/
total 0
-rw-r--r-- 1 root root 0 Nov  5 00:58 sv-s-bar
-rw-r--r-- 1 root root 0 Nov  5 00:58 sv-s-bletch
-rw-r--r-- 1 root root 0 Nov  5 00:58 sv-s-foo
For whatever reason I can get "mount -o subvolid=..." to work but not mount -o subvol=...".


Quote:
What i wanted was an easy; reliable way to keep a backup of my home using btrfs instead of just rsync. Unfortunately, in order to use snapshot, it needs to be on, or be a, subvolume.
I guess that makes sense, so the approach would be to snapshot the mounted subvolume at /home or whatever - right ? What's the difficulty ?
UUID=97ac420f-2818-4833-b7b6-4ac497716e3b /home btrfs subvolid=257,autodefrag,compress 1 2

Quote:
So; I rebooted into single user, mv'ed /home/eric to /home/eric-btrfs, made a subvolume in /home/ named 'eric' to take the place of my home, and cp'ed all of my files from eric-btrfs to eric, a quick chown, and chmod to get the file permissions right.
Bad approach - you want to use "cp -prZ from to" to keep the permissions, ownership and SEL context intact. Fixing them after the fact is error prone and difficult.
[/QUOTE]

I'm a btrfs noob too. Hope that is of some help.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
Reply

Tags
btrfs, home, subvolume

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] BTRFS and F16 tox F16 Development 10 10th August 2011 12:48 AM
btrfs /home partition stopped mounting... megaloman Using Fedora 0 7th August 2011 12:44 PM
btrfs - add RAID1 partition to existing encrypted btrfs parition techmum Using Fedora 0 4th July 2011 01:21 AM
update on BTRFS in F15 tox F16 Development 27 8th January 2011 12:23 AM
btrfs suitable yet ? Milena Installation and Live Media 5 31st January 2010 09:35 AM


Current GMT-time: 13:07 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat