> Date: Thu, 27 Sep 2012 09:38:58 +1000
> From: nippur@tpg.com.au
> To: James_McMechan@hotmail.com
> Subject: strange behaviour of ubd
> Hello James,
> I have been using User Mode Linux since 2004 as virtual lab for studying.
> I have always used ubdb,c,d and so on to have more than a "bare" file system
> to play with: a good file system without an access to a cdrom,dvd,usb and so
> on is not very interesting ( and Internet is not always available).
> I am a little frustrated because "ubd" is working only for "root_fs" : no

It appears that you are backing your ubd device with a physical drive
Nothing wrong with that, but it is not a case I use much,
you should be able to use any virtual block device not backed directly to hardware
virtual drives that are mapped to hardware it appears may need to be fixed to
use an alternate method of finding out how big the drive is and possibly fixing
up the special ioctl calls like eject.

> cdrom, no dvd and so on ( I am using debian squeeze 64bit). I have verified
> similar behavior with debian testing (kernel 3.2.x). I have been playing with
> every combination of parameter of activation.
> The result : linux ubda=root_fs ubdb=/dev/cdrom does not work AT ALL.

I will have to try this, is it only ubdb that is failing or does it take down ubda also?

> It worked, I have already used with kernel 2.4.x.
It used to work when the host system was running 2.4.x for example debian
running on a real machine and running a UML on top. Correct?
I have run very recent kernels on top of very old host systems. A 2.4.18 host
for example, running a 3.2 UML on top. 

> Internet is full of crappy/obsolete stuff.
> Everyone is avoiding (on purpose i guess) to talk about this: only examples
> about swap !!!
No, I expect people just don't think to do it this way very often.
Last time I backed with physical drives I had a 30 drive RAID array that was
throwing ICRC errors every day or so and dropping a drive. Since ICRC is
basically harmless (checksum error on a IDE/SATA cable, it retries) this was
a hassle for no gain so I ran my recovery inside a UML since it could not to it
in a read only fashion before another ICRC came in and broke the entire
RAID array.

> I am writing to you because I have found a "dirty" trick and it is working
> better than expected.
> file : ubd_kern.c function ubd_add ( ) line number 831 : I have simply
> enclosed the goto in a comment.
> 833 err = ubd_file_size(ubd_dev, &ubd_dev->size);
> 834 if(err < 0){
> 835 *error_out = "Couldn't determine size of device's file";
> 836 /* goto out; */ MODIFIED by me !!!!
> 837 }
> 838
Yes, we should have a better solution however.
Maybe checking the errno and trying a different command to
find the drive size on physical drives (or virtual drives in a enclosing uml)

> well ... is working bloody well.
> If you want I can be more accurate if this is not enough for you .... ?!?!
> Please fix this problem ( ... mine is just a trick, of course).
> Thanks for your attention.
> Kind Regards.
> Sal Poleo
> p.s. : I am a really good fan of this project.
Glad to see that others are still using it too.
I like it also, and use it for hours, most days.

Jim McMechan