Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: "Jérôme Poulin" <jeromepoulin@gmail.com>
To: J G <yoosty_cmn@yahoo.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Odd mkbtrfs behavior inside of chroot
Date: Sun, 2 Jan 2011 16:06:20 -0500	[thread overview]
Message-ID: <7042580597121616144@unknownmsgid> (raw)
In-Reply-To: <915110.93115.qm@web112501.mail.gq1.yahoo.com>

Did you try using -o bind on /proc and /sys as well? Just in case mkfs
uses /sys too, I'm not sure if /proc reacts differently to multiple
mounts or bind neither?

Envoy=E9 de mon appareil mobile.

J=E9r=F4me Poulin
Solutions G.A.

On 2011-01-02, at 14:53, J G <yoosty_cmn@yahoo.com> wrote:

> 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-g1b=
444cd-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=
=2E 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=3DS_IFDIR|0755, st_size=3D4096, ...}) =3D 0
> lstat("/boot/sysrcd.dat", 0x7fffb29681e0) =3D -1 ENOENT (No such file=
 or directory)
> close(3)                                =3D 0
> munmap(0x7f11df372000, 4096)            =3D 0
> write(2, "error checking /dev/sda5 mount s"..., 38error checking /dev=
/sda5 mount status
> ) =3D 38
>
>
> doesn't explain much. I see that it's checking /proc/mounts to see wh=
at's mounted, and then it fails on stating /boot/sysrcd.dat (which does=
n'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 v=
ersion, it works fine.
>
> Any ideas here? I would expect that mkbtrfs would work inside of a ch=
root 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:.
>
>
>
> --
> 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
--
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

  reply	other threads:[~2011-01-02 21:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-02 19:52 Odd mkbtrfs behavior inside of chroot J G
2011-01-02 21:06 ` Jérôme Poulin [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7042580597121616144@unknownmsgid \
    --to=jeromepoulin@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=yoosty_cmn@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox