[dundee] filesystem files

Lee Hughes toxicnaan at yahoo.co.uk
Fri Sep 14 14:27:57 BST 2007


an interesting email?


Nistur <nistur at googlemail.com> wrote: I was having a chat last night at the counting house and rememebred something I was fiddling around with a few months ago but never got sorted.

>> Okay..

I have a Windows Mobile based phone. I have 2x 2GB SD cards. I have an SD card reader on my laptop. I have  1.4GB mini DVD-Rs

>>OKay

Basically, I was wondering if there was any way to back up the SD cards into a single file archive, but with no compression. I never use more than 1.4GB on any card

okay >> if you don't use more the 1.4GB on a card,
then you can backup without compression. however
if you use dd, then it will backup at the block level,
so it will actually copy empty space too!, so
you got a few options.

1. Create a 600MB file of 'zero bytes)...
then to backup do dd=if=/dev/yousdcard - | gzip > mybackup

you should get a file smaller than 1.4GB

if you get larger than 1.4GB, you could always split in into two 1GB images???

I don't think you can use sparse files either, as you
just doing an image.

you should be able to mount this if it is a sane
file system.

just do

then to backup do dd=if=/dev/yousdcard of=mybackup

something like.


mount myback /mountpoint -t auto -o loop
should be able to mount it!! if it's fat 32...

obviiosuly just reverse the dd if you want to put it back
this maybe be slow!!!! be aware the sd cards have a limited write capacity, so very time you swap data, you
lowering the lifetime of your sdcard. it may prove better
to rsync if bits of your sd card don't change.


, but would like to have more than 2 options, say 1 for music, one with photos, one with graphics applications, one with emulators and roms etc. In the end I would like to automate it so I can switch the contents of the cards, with a shell script for example. 

>>that should be easy.

I was kinda hoping dd would give me an option to only copy until the partition went blank. 
The reason for me not wanting any compression is mainly the photos, the camera on it is crap, but of some use anyway, however if I keep compressing and uncompressing over and over again, I'm eventually going to end up with every file being one large pixel. 

>> what are you going on about? I think you need to
lookup the difference between lossy and unlossy compression systems. gzip never looses data bits
I think you have you knicker in a twist over this.



On a similar note, is it possible to create a filesystem within a file and mount it with -o loop but not have to set the file size before. I have managed to create a 4GB ext3 file but was wondering whether it would be possible to have one with a variable size, the more you put in it, the bigger it got kinda thing. 

>> yeah, you need to create a sparse file, sparse files 
can be any size, but unix only allocates real blocks on
disk when you write to them do a search for sparse files unix dd and you should get results.




Thanks in advance

no thank you...

Nistur

>>it's lee actually.

 _______________________________________________
dundee GNU/Linux Users Group mailing list
dundee at lists.lug.org.uk  http://dundee.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/dundee
Chat on IRC, #tlug on dundee.lug.org.uk

       
---------------------------------
 For ideas on reducing your carbon footprint visit Yahoo! For Good this month.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/dundee/attachments/20070914/61ff6c9a/attachment.html


More information about the dundee mailing list