public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* btrfs-convert destroyed my system
@ 2014-01-18  3:30 Sir Civit
  2014-01-19  1:13 ` Marc MERLIN
  2014-01-19 18:51 ` Martin Steigerwald
  0 siblings, 2 replies; 4+ messages in thread
From: Sir Civit @ 2014-01-18  3:30 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org



To start off, I have an encrypted LVM setup with a root logical volume and a home 
logical volume. Today decided to upgrade my home LV to btrfs for 
compression. I installed btrfs-progs, unmounted /home, and ran
btrfs-convert /dev/MyVolumeGroup/home
and it completed with no errors reported. I rebooted my system, and I got a "Welcome to emergency mode!" message. I rebooted into a live CD and 
found that all of my logical volumes were showing up, but almost all of 
them showed status "NOT available". I ran vgck and lvck, both of which 
found no 
errors. I ran lvscan and still /dev/MyVolumeGroup/ (and 
/dev/mapper/MyVolumeGroup-*) contains only one of the LVs.

It seems that btrfs-convert possibly overwrote the LVM metadata somehow, but I have no idea how 
since the argument was a logical volume. Even if I had accidentally 
typed /dev/MyVolumeGroup, I would think that btrfs-convert should have 
realized that it was not an ext2/3/4 filesystem.

I tried mounting one of the "available" LVs, and got
mount: /dev/MyVolumeGroup/root is write-protected, mounting read only.
mount: special device /dev/MyVolumeGroup/root does not exist.

I've already 
started a fresh installation due to time constraints, but I'd like to 
find out why this happened and let everyone know about a potential bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: btrfs-convert destroyed my system
  2014-01-18  3:30 btrfs-convert destroyed my system Sir Civit
@ 2014-01-19  1:13 ` Marc MERLIN
  2014-01-20  3:46   ` Roger Binns
  2014-01-19 18:51 ` Martin Steigerwald
  1 sibling, 1 reply; 4+ messages in thread
From: Marc MERLIN @ 2014-01-19  1:13 UTC (permalink / raw)
  To: Sir Civit; +Cc: linux-btrfs@vger.kernel.org

On Fri, Jan 17, 2014 at 07:30:49PM -0800, Sir Civit wrote:
> 
> 
> To start off, I have an encrypted LVM setup with a root logical volume and a home 
> logical volume. Today decided to upgrade my home LV to btrfs for 
> compression. I installed btrfs-progs, unmounted /home, and ran
> btrfs-convert /dev/MyVolumeGroup/home
> and it completed with no errors reported. I rebooted my system, and I got a "Welcome to emergency mode!" message. I rebooted into a live CD and 
> found that all of my logical volumes were showing up, but almost all of 
> them showed status "NOT available". I ran vgck and lvck, both of which 
> found no 
> errors. I ran lvscan and still /dev/MyVolumeGroup/ (and 
> /dev/mapper/MyVolumeGroup-*) contains only one of the LVs.

What's the kernel verion?
What's the version of btrfs-tools?

For what it's worth I also tried a btrfs convert on ubuntu precise with
their stock kernel and old btrfs-tools and it mostly destroyed the
filesystem too, but at the same time I figured I got what I deserved for
running tools and a kernel that old on that machine (not mine, hence the
issue).

Marc
 
> It seems that btrfs-convert possibly overwrote the LVM metadata somehow, but I have no idea how 
> since the argument was a logical volume. Even if I had accidentally 
> typed /dev/MyVolumeGroup, I would think that btrfs-convert should have 
> realized that it was not an ext2/3/4 filesystem.
> 
> I tried mounting one of the "available" LVs, and got
> mount: /dev/MyVolumeGroup/root is write-protected, mounting read only.
> mount: special device /dev/MyVolumeGroup/root does not exist.
> 
> I've already 
> started a fresh installation due to time constraints, but I'd like to 
> find out why this happened and let everyone know about a potential bug.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: btrfs-convert destroyed my system
  2014-01-18  3:30 btrfs-convert destroyed my system Sir Civit
  2014-01-19  1:13 ` Marc MERLIN
@ 2014-01-19 18:51 ` Martin Steigerwald
  1 sibling, 0 replies; 4+ messages in thread
From: Martin Steigerwald @ 2014-01-19 18:51 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org; +Cc: Sir Civit

Am Freitag, 17. Januar 2014, 19:30:49 schrieben Sie:
> To start off, I have an encrypted LVM setup with a root logical volume and a
> home logical volume. Today decided to upgrade my home LV to btrfs for
> compression. I installed btrfs-progs, unmounted /home, and ran
> btrfs-convert /dev/MyVolumeGroup/home
> and it completed with no errors reported. I rebooted my system, and I got a
> "Welcome to emergency mode!" message. I rebooted into a live CD and found

Unless you changes fstab, I´d not be that surprised about this.

> that all of my logical volumes were showing up, but almost all of them
> showed status "NOT available". I ran vgck and lvck, both of which found no
> errors. I ran lvscan and still /dev/MyVolumeGroup/ (and
> /dev/mapper/MyVolumeGroup-*) contains only one of the LVs.

>From the live CD you probably have to issue

vgchange -ay

to make all volumes available.

> It seems that btrfs-convert possibly overwrote the LVM metadata somehow, but
> I have no idea how since the argument was a logical volume. Even if I had
> accidentally typed /dev/MyVolumeGroup, I would think that btrfs-convert
> should have realized that it was not an ext2/3/4 filesystem.

As to what I know this can´t be possible. A logical volume is a block device 
which boundaries the kernel does guarantee. A userspace application should not 
be able to write beyond these boundaries. Now it might by that part of the 
conversion is happening in kernel, but I doubt it… and… I think even then the 
kernel guarentees it unless the part of the kernel that does the writing 
deliberately writes into completely different memory (then lots of bad things 
could probably happen).

> I tried mounting one of the "available" LVs, and got
> mount: /dev/MyVolumeGroup/root is write-protected, mounting read only.
> mount: special device /dev/MyVolumeGroup/root does not exist.

What does dmesg say to this?

> I've already
> started a fresh installation due to time constraints, but I'd like to
> find out why this happened and let everyone know about a potential bug.

Do you have a backup?

I strongly recommend making one directly before such a bold conversion.

Thanks,
-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: btrfs-convert destroyed my system
  2014-01-19  1:13 ` Marc MERLIN
@ 2014-01-20  3:46   ` Roger Binns
  0 siblings, 0 replies; 4+ messages in thread
From: Roger Binns @ 2014-01-20  3:46 UTC (permalink / raw)
  To: linux-btrfs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 18/01/14 17:13, Marc MERLIN wrote:
> For what it's worth I also tried a btrfs convert on ubuntu precise
> with their stock kernel and old btrfs-tools and it mostly destroyed
> the filesystem too,

Just in case some folks think btrfs-convert never works, I had no problems
at all on two filesystems - a 128GB OS install & home directory on SSD and
a 2TB media disk (mainly ~7GB ISO files) on HDD.

The system was also Ubuntu 12.04 (Precise) running kernel 3.2.

Roger

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iEYEARECAAYFAlLcnAYACgkQmOOfHg372QRMnQCePTWBDwI8iEdw67KpIbqAuHCw
xp4Anjcp1lbHdcP4ZR8ThfdOPH1EkiXS
=msAu
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-20  3:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-18  3:30 btrfs-convert destroyed my system Sir Civit
2014-01-19  1:13 ` Marc MERLIN
2014-01-20  3:46   ` Roger Binns
2014-01-19 18:51 ` Martin Steigerwald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox