Re: client (-1) cannot open NBD device /dev/nda or similar:Nosuch file or directory

Peter Breuer <[email protected]> Mon, 10 Nov 2008 14:21:56 +0100 (CET)
Newsgroups gmane.linux.enbd.general
Message-ID <[email protected]>
"Also sprach Volker Stoppe:"
> I want to mirror a few server over the network to target mashines via  
> enbd/mdadm. If FR1 was developed for notebook users to do spontaneous  
> intellient RAID1 mirroring with an externel device, it should also be  
> suitable for my scenario.

Yes, but the FR1 code and designs moved into standard kernel softRAID ages
ago. About the only thing that didn't go in was the communication back
to the raid device from the enbd device when the enbd device felt ill
or got well again. But one can do that with udev nowadays (enbd signals
udev with the information .. the enbd udev rules file tells raid what
to do with the info, or can do, I've forgotten if it needs editing to
suit ...)


> Question: Is it possible to mirror the local disks without reorganizing  

I'm not sure what you mean .. is this a question about raid? I.e., can
linux soft raid mirror devices without requiring reformatting them? The
answer is more complex than a simple yes/no, it's something like "99%
yes" and "1% no".

That's essentially because what raid "formatting" exists is in the form
of a 64KB block after the end of the data area on the raided device (i.e.
just before the end of the data are on the underlying device). If your
"devices" are partitions of a disk, then they very likely have 64KB of
free space after the end of the partition and before the start of the
next partition, and you should expand the underlying partition size by
64KB (without changing the FS size on it at all!). That just means
playing with the partition-end numbers in fdisk and rebooting.

When you've rebooted you should have the extra 64KB available in which
to "format" the partition for the raid device (the format area is
called a "superblock").

But you don't actually need it for RAID1. mdadm will allow you to set
up raid1 devices WITHOUT superblocks, though I don't recall the syntax.
I wouldn't recommend it long term, because it's harder to fix munged
devices without the SB info, but it's feasible.


> them? I want to keep the structure of partitions and volumes. The best  

Volumes? Oh oh  .. if your partitions are virtual (LVM), then you
might struggle for the extra 64KB SB needed after each.

> thing would be a copy on write mechanism to the target machine by the enbd  
> / /dev/nda -device.

You're saying that you only want NEW writes to be sent across?
Presumably you would have cloned the device beforehand ... anyway, you
shouldn't worry about that. That's all mdadm stuff, and enbd will
generally also recognize equal stuff both sides and skip it on write
even if raid is trying to start from scratch.

> A kind of daemon observing changes on /dev/sda and  
> mirroring it to /dev/nda(x) would be fine.

?? It's called "raid"! That's what raid mirroring does.

> Does anyone know a solution? Googling didn't help very much.

Just try making the mirror to nda. It should work fine.

Peter