All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nikos Voutsinas" <nvoutsin@noc.edunet.gr>
To: linux-btrfs@vger.kernel.org
Subject: Re: BTRFS thinks that a device is mounted
Date: Sat, 22 Oct 2011 16:57:55 +0300	[thread overview]
Message-ID: <e0ac043e6f443df448791e3fcd6cdf0a.squirrel@webmail01.edunet.gr> (raw)
In-Reply-To: <slrnja2h84.5ku.stephane.chazelas@spam.is.invalid>

> 2011-10-21, 00:39(+03), Nikos Voutsinas:
> [...]
>> ## Comment: Of course /dev/sdh is not mounted.
>> mount |grep /dev/sdh
>> root@lxc:~#
> [...]
>
> Note that mount(8) uses /etc/mtab to find out what is mounted.
> And if that file is not a symlink to /proc/mounts, the
> information is not necessarily correct.
>
> You can also have a look at /proc/mounts directly.
>

OK, I found what went wrong, however I am not sure whose fault this is and
If I am going to describe a case that is already known to this list.

To cut a long story short, the consecutive

root@btrfs:~# btrfs device add /dev/sdc /
root@btrfs:~# btrfs device delete /dev/sdc /

led to inconsistency between the contents of /proc/mounts and
/dev/disk/by-uuid (ie the mapping of UUIDs to devices).

Actually, "btrfs device add /dev/sdc /" changed the mapping of root's UUID
to point to /dev/sdc, and the system left it this way, even after the
"btrfs device delete /dev/sdc /". Thus I ended up with the following
situation.

root@btrfs:~# cat  /etc/mtab /proc/mounts |grep btrfs
/dev/sdd2 / btrfs rw 0 0
/dev/disk/by-uuid/cc8211ba-6f62-46d6-ba17-49250f06a941 / btrfs rw 0 0
root@btrfs:~#
root@btrfs:~# ls -l /dev/disk/by-uuid/cc8211ba-6f62-46d6-ba17-49250f06a941
lrwxrwxrwx 1 root root 9 Oct 22 16:13
/dev/disk/by-uuid/cc8211ba-6f62-46d6-ba17-49250f06a941 -> ../../sdc

Although this may be a udev issue, I think that the userspace tools of
btrfs should have handled this in a better way.

Nikos



      reply	other threads:[~2011-10-22 13:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-20 21:39 BTRFS thinks that a device is mounted Nikos Voutsinas
2011-10-21  1:33 ` Helmut Hullen
2011-10-21 10:10 ` Stephane CHAZELAS
2011-10-22 13:57   ` Nikos Voutsinas [this message]

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=e0ac043e6f443df448791e3fcd6cdf0a.squirrel@webmail01.edunet.gr \
    --to=nvoutsin@noc.edunet.gr \
    --cc=linux-btrfs@vger.kernel.org \
    /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 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.