linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Jason Keltz <jas@cse.yorku.ca>
Cc: linux-raid@vger.kernel.org
Subject: Re: MD component device renaming with udev and MD on full disk
Date: Tue, 25 Nov 2014 13:55:09 +1100	[thread overview]
Message-ID: <20141125135509.4f32aea2@notabene.brown> (raw)
In-Reply-To: <546FB1B7.3050304@cse.yorku.ca>

[-- Attachment #1: Type: text/plain, Size: 3467 bytes --]

On Fri, 21 Nov 2014 16:42:15 -0500 Jason Keltz <jas@cse.yorku.ca> wrote:

> Hi.
> 
> I have two questions about MD..
> 
> 1) I've written a udev rule to remap /dev/sdX devices on my system to 
> /dev/cXeYsZpA (controller, enclosure, slot, partition) mapping. When I 
> reboot the system, I see that all the devices in /dev are appropriately 
> renamed.  If I look at /proc/mdstat, it still has the kernel names of 
> the devices (/dev/sdX) even though those devices no longer exist.  If I 
> do an mdadm --detail /dev/mdX the system reports the proper device name 
> makeup.  I manually failed a device, and I got the correct device name 
> in the email.  I'm just wondering what command I would execute to make 
> /proc/mdstat update the devices in its output?

Names in /dev/ are link symlinks.  They point to the device (which is
identified by a pair of numbers: e.g. 8,1), but they aren't the device itself.

block device 8,1 is always "sda1" to the kernel, whether you access it through
a block-special file called "/dev/sda1" or "/dev/box-of-bits".

The names reported by /proc/mdstat are the kernel's internal names for the
devices.  You cannot get it to use the names that you have created in /dev.

"mdadm -D" is the best way to describe an array in terms of names that you
have chosen.


> 
> 2) Unrelated to 1) -- the argument re: using MD on full devices versus 
> partitions has been around for a long time.  I've been experimenting 
> with using it on full devices.  One of the arguments that I've read for 
> not using full devices is that apparently, if you have two devices that 
> are identical, but one of them is slightly smaller than the other due to 
> say, bad sectors, then these disks can't be used together in one MD 
> because they are different sizes. I'm wondering how valid that argument 
> is?  Surely it would make sense if MD was using full devices for it to 
> actually stop short of the end of the disk for situations like these...

There is no validity at all in that argument.
md is quite happy using devices of different sizes and will ignore extra
space provided on the larger device.

If you had an array with two devices of size X, and got a new device of size
"X - delta", then it is true that the new device cannot be used in the array.
I think I have read a suggestion of creating partitions smaller than the
device so that when the "X - delta" device is used, it is still big enough
for that smaller partition.

There are two reasons why this is an invalid argument for using partitions:
1/ modern drives have standardised sizes.  If you have a size-X device, then
   you will not find a size-"X - delta" device unless "delta" is very big.

2/ you can use the --size option of mdadm to make the array use less than
   the total space on the device to allow for later reconfigurations.

There are other valid  reasons for preferring whole devices or partitions,
such as some tool or other might get confused by one of the arrangements
(e.g. lilo or and installer).  And some people might be more comfortable with
one than the other.
But the size issue is completely irrelevant.

NeilBrown


> 
> Thanks for any help you can provide.
> 
> Jason.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

      reply	other threads:[~2014-11-25  2:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 21:42 MD component device renaming with udev and MD on full disk Jason Keltz
2014-11-25  2:55 ` NeilBrown [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=20141125135509.4f32aea2@notabene.brown \
    --to=neilb@suse.de \
    --cc=jas@cse.yorku.ca \
    --cc=linux-raid@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 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).