<div dir="ltr">thanks for your help<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 12, 2014 at 2:53 PM, Baruch Siach <span dir="ltr"><<a href="mailto:baruch@tkos.co.il" target="_blank">baruch@tkos.co.il</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Erez,<br>
<div class=""><br>
On Mon, May 12, 2014 at 02:14:34PM +0300, Erez D wrote:<br>
> On Mon, May 12, 2014 at 12:28 PM, Baruch Siach <<a href="mailto:baruch@tkos.co.il">baruch@tkos.co.il</a>> wrote:<br>
</div><div><div class="h5">> > On Mon, May 12, 2014 at 12:14:14PM +0300, Erez D wrote:<br>
> > > On Mon, May 12, 2014 at 12:05 PM, Baruch Siach <<a href="mailto:baruch@tkos.co.il">baruch@tkos.co.il</a>><br>
> > wrote:<br>
> > > > On Mon, May 12, 2014 at 11:46:43AM +0300, Erez D wrote:<br>
> > > > > i need to clone a nand flash. which has ubifs on it<br>
> > > > ><br>
> > > > > doing 'dd' didn't work as the source and dest have different bad<br>
> > sectors.<br>
> > > ><br>
> > > > dd is not the way to go with raw NAND flash access; it's not aware of<br>
> > bad<br>
> > > > blocks.<br>
> > > ><br>
> > > > > is there an easy way to clone a ubifs nand-flash ?<br>
> > > ><br>
> > > > You may be able get a working system using nanddump/nandwrite (see<br>
> > > > <a href="http://thread.gmane.org/gmane.linux.drivers.mtd/45792/focus=46024" target="_blank">http://thread.gmane.org/gmane.linux.drivers.mtd/45792/focus=46024</a>, but<br>
> > > > read<br>
> > > > the whole thread). Generally, tough, this is not what you want to do<br>
> > with<br>
> > > > UBI/UBIFS. You should use ubiformat on the target, and copy the content<br>
> > > > with<br>
> > > > tar. See<br>
> > <a href="http://www.linux-mtd.infradead.org/faq/ubifs.html#L_why_ubiformat" target="_blank">http://www.linux-mtd.infradead.org/faq/ubifs.html#L_why_ubiformat</a><br>
> > ><br>
> > > will tar preserve uid/gid hard links, special files, /dev<br>
> ><br>
> > Yes, by default.<br>
> ><br>
> > > extended attr etc ?<br>
> ><br>
> > Yes. Use --xattrs.<br>
> ><br>
> > baruch<br>
><br>
> thanks, i'll try that.<br>
><br>
> can I ubiformat + untar from u-boot ?<br>
<br>
</div></div>I don't see support for either in mainline U-Boot. Barebox supports ubiformat<br>
but not tar extraction.<br>
<br>
Your best option is to boot into RAM using a kernel combined with a minimal<br>
Busybox based initramfs, and extract you tar from there. Note tough that<br>
Busybox tar does not support extended attributes, so you must use GNU tar for<br>
this. Buildroot can generate a minimal initramfs image for you quite easily.<br>
<span class="HOEnZb"><font color="#888888"><br>
baruch<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
--<br>
<a href="http://baruch.siach.name/blog/" target="_blank">http://baruch.siach.name/blog/</a> ~. .~ Tk Open Systems<br>
=}------------------------------------------------ooO--U--Ooo------------{=<br>
- <a href="mailto:baruch@tkos.co.il">baruch@tkos.co.il</a> - tel: <a href="tel:%2B972.2.679.5364" value="+97226795364">+972.2.679.5364</a>, <a href="http://www.tkos.co.il" target="_blank">http://www.tkos.co.il</a> -<br>
</div></div></blockquote></div><br></div>