linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Peter Rajnoha <prajnoha@redhat.com>
To: Mahmood Naderan <nt_mahmood@yahoo.com>
Cc: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Add a disk from remote node to LVM
Date: Wed, 07 May 2014 14:20:12 +0200	[thread overview]
Message-ID: <536A24FC.4010907@redhat.com> (raw)
In-Reply-To: <1399457072.41382.YahooMailNeo@web141606.mail.bf1.yahoo.com>

On 05/07/2014 12:04 PM, Mahmood Naderan wrote:
> 
> 
> 
>> How do you mean "remote drive" exactly? What type is it - is it iscsi, nbd...?
> 
> There are two nodes in a single rack. Each has 4 slots for SATAII disks. Current configuration is
> 
> 
> N1: /dev/sda, /dev/sdb, /dev/sdc, /dev/sdd where the last three (b, c, d) are grouped in in a single LVM volume.
> 
> 
> N2: /dev/sda, /dev/sdb where the last one (b) is free and I want to add it to the LVM of N1.
> 
> Each node is running an independent operating system (scientific linux)Currently /dev/sdb on N2 is not shared. I have just format it as ext4 (which is the same format as the LVM of N1).
> 
> 

One option here is to export the sdb on N2 as iscsi target and then connect
it to N1 node. But you must be very careful that nothing touches the sdb on N2
(mainly not writing anything to the drive or not trying to activate anything that
can be found on the drive), including LVM itself. As for LVM, you should configure
global_filter (or filter if you have older version of LVM) in /etc/lvm/lvm.conf
to exclude sdb on LVM scans (also, be cautious that under some circumnstances
"sdb" is not stable name and kernel can assign a different name on next reboot).

For example you can have a look at these howtos - there are slight differences
amongst distributions, mainly the package names, but the logic stays the same:

http://www.howtoforge.com/using-iscsi-on-fedora-10-initiator-and-target
http://www.howtoforge.com/using-iscsi-on-debian-squeeze-initiator-and-target
http://www.howtoforge.com/using-iscsi-on-ubuntu-10.04-initiator-and-target

But iscsi is just one option, there are more options how to export a drive
and attach it on remote node... You can also check for "nbd" (network block device),
that's another way that comes to my mind at the moment.

Though the best in your case would be if you could just attach the drive
physically to the machine where needed, if possible, of course.

> 
>> But essentially, you need to connect the remote drive first and then do a pvcreate and vgextend.
> 
> Should I run these commands on N1 or N2?

Once you have the remote drive attached (let's say it ends up attached as sdx on N1),
just use:

pvcreate /dev/sdx
vgextend vg /dev/sdx

(replace sdx and vg with actualy drive and vg name)

And you're done.

-- 
Peter

  reply	other threads:[~2014-05-07 12:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-07  7:33 [linux-lvm] Add a disk from remote node to LVM Mahmood Naderan
2014-05-07  9:40 ` Peter Rajnoha
2014-05-07 10:04   ` Mahmood Naderan
2014-05-07 12:20     ` Peter Rajnoha [this message]
2014-05-07 14:53       ` Mahmood Naderan
2014-05-07 13:00     ` Marian Csontos

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=536A24FC.4010907@redhat.com \
    --to=prajnoha@redhat.com \
    --cc=linux-lvm@redhat.com \
    --cc=nt_mahmood@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;
as well as URLs for NNTP newsgroup(s).