All of lore.kernel.org
 help / color / mirror / Atom feed
* Odd mkbtrfs behavior inside of chroot
@ 2011-01-02 19:52 J G
  2011-01-02 21:06 ` Jérôme Poulin
  2011-01-02 23:14 ` Goffredo Baroncelli
  0 siblings, 2 replies; 6+ messages in thread
From: J G @ 2011-01-02 19:52 UTC (permalink / raw)
  To: linux-btrfs

I just encountered some odd behavior from mkbtrfs.
The end goal is to restore a backup to newly created BTRFS partitions while using the latest btrfs-tools. 
Here's the steps to what I did:
* Booted SystemRescueCD
* Partitioned the drives (two 750GB drives with 12 partitions each)
* Created an extra partition on sda as a temporary holding place for the backed up files and so I can update btrfs-tools
* Formatted/mounted/restored backup files to the temporary partition which I mounted on /mnt/backup
* mount -t proc none /mnt/backup/proc; mount -o bind /dev /mnt/backup/dev
* chroot /mnt/backup /bin/bash
* Updated btrfs-tools to the latest git pull from today (v0.19-35-g1b444cd-dirty).
* mkbtrfs /dev/sda5 /dev/sdb5 -L root

mkbtrfs returned with:

error checking /dev/sda5 mount status

So I used strace to find out how it was checking for the mount status. Now, I'm no expert here, but I'm confused as to just why it failed. The last thing of note:

lstat("/boot", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/boot/sysrcd.dat", 0x7fffb29681e0) = -1 ENOENT (No such file or directory)
close(3)                                = 0
munmap(0x7f11df372000, 4096)            = 0
write(2, "error checking /dev/sda5 mount s"..., 38error checking /dev/sda5 mount status
) = 38


doesn't explain much. I see that it's checking /proc/mounts to see what's mounted, and then it fails on stating /boot/sysrcd.dat (which doesn't exist in the non-chrooted FS, btw).

To make this even weirder, if I format sda5/sdb5 using the SysRescCD version of mkbtrfs (v0.19) and then format sda5/sdb5 using the chroot version, it works fine.

Any ideas here? I would expect that mkbtrfs would work inside of a chroot without any assistance from the original root.

I have the full strace from the chrooted mkbtrfs failing and from it succeeding, if that's helpful.


.:Justin:.


      

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

end of thread, other threads:[~2011-01-04 23:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-02 19:52 Odd mkbtrfs behavior inside of chroot J G
2011-01-02 21:06 ` Jérôme Poulin
2011-01-04 23:12   ` J G
2011-01-02 23:14 ` Goffredo Baroncelli
2011-01-03 19:05   ` [PATCH] add a --force option to mkfs.btrf [was Re: Odd mkbtrfs behavior inside of chroot] Goffredo Baroncelli
2011-01-04 23:16   ` Odd mkbtrfs behavior inside of chroot J G

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.