linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Stephane Chazelas <stephane.chazelas@googlemail.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Determine boot disk device name...
Date: Mon, 25 Oct 2010 19:16:49 -0000	[thread overview]
Message-ID: <1288034225.4299.14.camel@sc.lan> (raw)
In-Reply-To: <AANLkTikX3+Dr5b-QQLZUquTvZ_YYuv8rB_nh=8ocmHvW@mail.gmail.com>

On Sat, 2010-10-23 at 22:58 -0400, Jon Price wrote:
> 
> Hi,
> For starters, how can I determine the physical device name of
> current/active boot disk in Linux?
[...]

Please clarify what you mean by "physical device" and "boot disk"
especially when refered to as "current/active".

Note that Linux can start on disk-less machines. "boot"ing generally
means the process that kick-starts an operating system, so there's
nothing "current" of "active" about it, it's something that happens once
and is over by the time the system is running.

If you mean where the root filesystem reside, you can do a stat(2) on /
and look at M=major(st.st_dev) and m=minor(st.st_dev).

You can look-up M in /proc/devices.

For LVM, you'll find it's "device-mapper".

You can do a dmsetup table /dev/dm-<m> to see how that is configured.

You may find for instance that it's a mirror on two scsi drives, or that
it's a raid0 on 2 loop devices. You may then use losetup to see which
files they loop on. Then do a stat(2) again on those, and you may find
that they are on network blocks which are themselves shared by another
machine from a file shared over NFS off a 3rd machine, which is virtual
and has its backend stored in a qcow2 virtual drive itself stored on a
dm-raid and with copy-on-write on another file somewhere else, at which
point you might be able to find out about the serial number of the hard
drives they're on if that's what you're after...

-- 
Stephane

  parent reply	other threads:[~2010-10-25 19:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-24  2:58 [linux-lvm] Determine boot disk device name Jon Price
2010-10-25 18:11 ` Malahal Naineni
2010-10-25 19:21   ` Alexander Skwar
2010-10-25 21:28     ` Malahal Naineni
2010-10-26  8:29       ` Alexander Skwar
2010-10-26 18:41         ` Malahal Naineni
2010-10-26 18:55           ` Ray Morris
2010-10-25 19:16 ` Stephane Chazelas [this message]
2010-12-02  3:12   ` Stuart D. Gathman
2010-10-27  5:52 ` Luca Berra

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=1288034225.4299.14.camel@sc.lan \
    --to=stephane.chazelas@googlemail.com \
    --cc=linux-lvm@redhat.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;
as well as URLs for NNTP newsgroup(s).