Results 1 to 3 of 3

Thread: installation on btrfs

  1. #1
    Join Date
    Oct 2010
    Beans
    2

    Question installation on btrfs

    Hi

    I installed ubuntu on an btrfs disk. The installer created "@" and "@home" as subvolume. "@" should be / and "@home" should be /home when booted. But "@" is empty and / is directly on /dev/sda5. What went wrong?

    Some more Information.
    Code:
    # btrfs subvolume list /
    ID 256 top level 5 path @
    ID 257 top level 5 path @home
    in /etc/fstab the root partition is mounted in subvolume @ and home is mounted in subvolume @home
    Code:
    UUID=... /               btrfs   defaults,subvol=@ 0       1
    UUID=... /home           btrfs   defaults,subvol=@home 0       2
    when i look at my root (/) it looks like this:
    Code:
    # ls /
    @     cdrom  home        initrd.img.old  media  proc  sbin     sys  var
    bin   dev    @home       lib             mnt    root  selinux  tmp  vmlinuz
    boot  etc    initrd.img  lib64           opt    run   srv      usr  vmlinuz.old
    "@" and "@home" shouldn't be there!!
    /@ is empty
    /@home is the users dir
    /home is also the users dir

    #mount says
    Code:
    /dev/sda5 on / type btrfs (rw,subvol=@)
    /dev/sda5 on /home type btrfs (rw,subvol=@home)
    Does anybody know why @ is not root and is not populated with files?
    Last edited by HaraldWeber; June 20th, 2012 at 11:44 AM. Reason: solved

  2. #2
    Join Date
    Oct 2010
    Beans
    2

    Exclamation Re: installation on btrfs

    Finally i managed it myself.

    I did the following to move the root partition to a btrfs subvolume.

    I booted from a live usb-stick.

    Mounted the btrfs disk and subvolume
    Code:
    mkdir -p /mnt/btrfs-disk /mnt/btrfs-root
    mount /dev/sda5 /mnt/btrfs-disk
    mount -o subvol=@ /dev/sda5 /mnt/btrfs-root (my actual root subvolume)
    Copied the root partition to the '@' subvolume (/mnt/btrfs-root)
    Code:
    rsync -raHAX --exclude '@,home, @home and so on' /mnt/btrfs-disk /mnt/btrfs-root
    Edited grub.conf to boot from subvolume '@' instead of /dev/sda5
    Code:
    linux	/@/boot/vmlinuz-3.2.0-25-generic root=UUID=0899f4b5-a8d5-4499-95b8-4f075f9cf543 ro rootflags=subvol=@   quiet splash $vt_handoff
    Chrooted into the '@' subvolume
    Code:
    mount -o bind /dev /mnt/btrfs-root/dev
    mount -o bind /sys /mnt/btrfs-root/sys
    mount -t proc /proc /mnt/btrfs-root/proc
    cp /proc/mount /mnt/btrfs-root/etc/mtab
    chroot /mnt/btrfs-root /bin/bash
    Then installed and updated Grub
    Code:
    grub-install /dev/sda
    update-grub
    Then i moved all directories except '@' and '@home' (subvolumes) to /oldRoot (can be deleted)
    reboot and now its working!!

  3. #3
    Join Date
    Jan 2008
    Location
    France
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: installation on btrfs

    Thanks for the feedback.

    Please create a bug report on Launchpad (via "ubuntu-bug linux" for example) and indicate the report URL here so that we can follow up.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •