This discussion is archived
8 Replies Latest reply: Sep 9, 2012 6:18 PM by jwmitchell RSS

Not able to convert LVM root to BtrFS in OL6

jwmitchell Newbie
Currently Being Moderated
I followed the instructions in the following post:
HOWTO: Converting LVM root to BtrFS in Oracle Linux 6
but broke out /home, /var, and /tmp into their own subvolumes.
However, upon reboot I get many services failing to start:
Calling the system activity data collector (sadc): Cannot open /var/log/sa/sa09: Permission denied

init: Unable to connect to the system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

Starting system logger: FAILED
Starting system message bus: FAILED
Starting HAL daemon: FAILED
Starting sshd: FAILED
It seems that upon reboot the sockets which were excluded during the tar
find . -type s > /$$
tar -cf - . -X /$$ | (cd /mnt/usb; tar -xf -; sync)
are not recreated. Any thoughts?
  • 1. Re: Not able to convert LVM root to BtrFS in OL6
    Dude! Guru
    Currently Being Moderated
    It seems processes are not starting and therefore not creating the special socket files.

    Please provide more detailed info about your system, in particular about /var.
  • 2. Re: Not able to convert LVM root to BtrFS in OL6
    jwmitchell Newbie
    Currently Being Moderated
    What would you like to know?

    It was an OL6.3 system, with a three logical volumes (/, /home, /var) on sda3. sda1 is /boot and sda2 is swap. It was a fresh install of only the base package group plus the btrfs programs.

    I followed your instructions except I made a separate backup for each of the logical volumes. When I created the btrfs root filesystem, I used made subvolumes for /home and /var, and /tmp, primarily to enforce quotas. System rebooted and SELinux did the relabel ok, rebooted again and the services started failing.

    I redid the entire thing again, thinking I missed something, but got the same end result.
  • 3. Re: Not able to convert LVM root to BtrFS in OL6
    Dude! Guru
    Currently Being Moderated
    The problem might be that your system is not mounting the /var volume. Did you convert /var to BtrFS? Is /var still under LVM? Did you modify gurb.conf and fstab accordingly? I cannot guess you configuration. I suggest to post the content of relevant files. Can you boot into single user mode and mount the volumes?
  • 4. Re: Not able to convert LVM root to BtrFS in OL6
    jwmitchell Newbie
    Currently Being Moderated
    Yes, var was converted to btrfs and is no longer under the control of the lvm. I didnt realize that var needed an entry in the fstab, thought btrfs would auto mount it. I did modify fstab and grub as indicated in your instructions. When booting up from the fedora live cd everything is accessible, once manually mounted. Let me try adding var to fstab
  • 5. Re: Not able to convert LVM root to BtrFS in OL6
    jwmitchell Newbie
    Currently Being Moderated
    Here is my fstab:

    /dev/sda3 / btrfs defaults 1 1
    /dev/sda2 swap swap defaults 0 0
    tmpfs /dev/shm tmpfs defaults 0 0
    devpts /dev/ptrs devpts gid=5,mode=620 0 0
    sysfs /sys sysfs defaults 0 0
    proc /proc proc defaults 0 0

    I tried adding a line for /var

    /dev/sda3 /var btrfs defaults,subol=var 0 1

    but that didn't help.

    Also, once the system is booted, /var, /tmp, /home are all accessible and mounted without any further work on my part.
  • 6. Re: Not able to convert LVM root to BtrFS in OL6
    Dude! Guru
    Currently Being Moderated
    You will have to put your mounted partitions into /etc/fstab, otherwise they won't be mounted at system startup. You will have a /var directory, but it will not contain the necessary directory structure for the programs to create their files.

    This was probably the reason why it did not work, plus you may have confused partitions and their mount points:
    /dev/sda3 /var btrfs defaults,subol=var 0 1
    Is subol valid?

    An more importantly: / dev/sda3 is already used for / (root). It can't be right.

    /var might be /dev/sda4 or /dev/sda5. You should know.

    I suggest to use the following entry in /etc/fstab:

    /dev/sda4 /var defaults 1 2
    /dev/sda5 /tmp defaults 0 2
  • 7. Re: Not able to convert LVM root to BtrFS in OL6
    jwmitchell Newbie
    Currently Being Moderated
    Understood on the paritions. So here is what I have for partitions:

    sda1 = /boot
    sda2 = swap
    sda3 = / (remainder of disk)

    Once the root partition was migrated to btrfs, I created subvolumes for /tmp, /home, and /var and moved the data taken from the backup into the newly created subvolumes. Once the system boots up, everything in / is available and mounted as expected. It seems to be just during bootup that I have a problem. Perhaps having /var as a subvolume isn't supported? Seems odd that this would be the case. I only added /var into the fstab to see if it required an entry during bootup. Normally I wouldn't have that entry.
  • 8. Re: Not able to convert LVM root to BtrFS in OL6
    jwmitchell Newbie
    Currently Being Moderated
    So I went ahead and did the conversion again, but I didn't make /var a subvolume. It's just another directory under/. Everything worked as expected. Must be something with having/var as a subvolume.