On 06/01/15 at 12:59pm, Dave Young wrote:
On 04/15/15 at 11:15am, Dave Young wrote:
> On 04/14/15 at 05:45pm, Minfei Huang wrote:
> > Do someone who can help review my patch?
>
> Please resend the patch, I do not keep old mails for long time..
>
> >
> > Thanks
> > Minfei
> >
> > On 03/09/15 at 07:34pm, Minfei Huang wrote:
> > > One filesystem has an unique uuid to detect itself. For btrfs, several
> > > diskes can have the same uuid, and the soft link /dev/disk/by-uuid/$uuid
> > > points the only one disk which is contained in the btrfs.
> > >
> > > It may fails to filter out the disk by uuid, although there is a
> > > filesystem on the disk, like btrfs.
> > >
> > > In order to get the persistent device, we can use command
"blkid".
>
> Several questions:
>
> What is the persistant device name for device formated as btrfs?
>
> How does udev create /dev/by-uuid/* links for each sub volume?
>
> What's the difference between blkid and other files in /dev/by-uuid/*
Ping, you have resent the patch but did not answer these questions...
Thanks.
I will quote the answer in this thread to integrate the commit log.
Thanks
Minfei
>
> > >
> > > Signed-off-by: Minfei Huang <mhuang(a)redhat.com>
> > > ---
> > > mkdumprd | 16 ++++++++++++++--
> > > 1 file changed, 14 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/mkdumprd b/mkdumprd
> > > index 4d251ba..5fb578b 100644
> > > --- a/mkdumprd
> > > +++ b/mkdumprd
> > > @@ -27,14 +27,14 @@ perror() {
> > > }
> > >
> > > get_persistent_dev() {
> > > - local i _tmp _dev
> > > + local i _tmp _dev _uuid
> > >
> > > _dev=$(udevadm info --query=name --name="$1"
2>/dev/null)
> > > [ -z "$_dev" ] && {
> > > perror_exit "Kernel dev name of $1 is not found."
> > > }
> > >
> > > - for i in /dev/mapper/* /dev/disk/by-uuid/* /dev/disk/by-id/*; do
> > > + for i in /dev/mapper/* /dev/disk/by-id/*; do
> > > _tmp=$(udevadm info --query=name --name="$i"
2>/dev/null)
> > > if [ "$_tmp" = "$_dev" ]; then
> > > echo $i
> > > @@ -42,6 +42,18 @@ get_persistent_dev() {
> > > fi
> > > done
> > >
> > > + if [ "x" != "x""$(blkid $1 | grep
"UUID")" ]; then
> > > + _uuid=`blkid $1 | grep "UUID" | awk '{print
$2}'`
> > > + _uuid=${_uuid#*\"}
> > > + _uuid=${_uuid%\"*}
> > > + _dev=/dev/disk/by-uuid/$_uuid
> > > + _tmp=$(udevadm info --query=name --name=$_dev 2>/dev/null)
> > > + if [ "x" != "x"$_tmp ]; then
> > > + echo $_dev
> > > + return
> > > + fi
> > > + fi
> > > +
> > > perror "WARNING: Persistent device name of $1 not found. Using
$1 as dump target name"
> > > echo $1
> > > }
> > > --
> > > 1.9.3
> > >
> > _______________________________________________
> > kexec mailing list
> > kexec(a)lists.fedoraproject.org
> >
https://lists.fedoraproject.org/mailman/listinfo/kexec
> >
> >
> _______________________________________________
> kexec mailing list
> kexec(a)lists.fedoraproject.org
>
https://lists.fedoraproject.org/mailman/listinfo/kexec