I have recently gotten back to making Voyage USB drive systems. We use these for network testing, most often iperf with tcpdump and analysis. It is very useful to have a modifiable system so I am not using squeezefs, but I would also like to make the images as small as possible for transfer over WAN links.
So, I have a 1 GB USB drive as the master, and a compressed image was 600 MB. This week I reduced that to 200 MB by making a large zero filled file in all of the empty disk space and then deleting it before doing the dd image copy and gzipping. 700 MB of zeros compresses a lot better than random bits! Tonight I successfully used gpartd to expand the file system after the 1 GB image was copied to a 4 GB USB flash drive. Jon 2011/10/12 <[email protected]> > Greets, > > Thanks for sharing this -- any tips that can help people deploy Voyage are > helpful. > > I use a similar process to what you described -- I keep an old MBR lying > around (heh) with a partition table that I just so happen to like. When I > create the first partition, I create the partition with the target size, > then the rest of the partitions (I have a VERY small swap whose sole purpose > is to prevent crashes -- the total swap traffic is non-existent, and when > the systems swap, I find out why and fix that). THEN I go back and delete > the root partition and make it a small size -- I'm up to 640MB right now. I > then DD in the root image I have, all 620 or 630MB of data. > > Once the root partition has been imaged this way, I go back, delete the > first partition a second time, then expand it to fit all the space it fit > before. Why do it this way? Because this way I know when the image file is > too large -- it's a check for the DD that I use to image that partition. > Also, if I need to capture the partition image, the partition is still only > 640MB and I'm not stuck playing games to trim it down. > > With the root partition back to the size I want, I can now expand the > filesystem to fit all available space. > -- > Julie Haugh > Senior Design Engineer > greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on > Skype > > > -------- Original Message -------- > Subject: [Voyage-linux] Re: Question about copying Voyage installation > on CFs > From: Gustin Johnson <[email protected]> > Date: Wed, October 12, 2011 4:19 pm > To: Emilio Arrufat <[email protected]> > Cc: voyage linux Mailing List <[email protected]> > > > Also CC'ing the list as this may be useful to some. > > The procedure that you listed should have worked if you had > partitioned the new CF card first. > > The first 512 bytes of a disk contain the MBR (Master Boot Record) and > partition table. The first 446 bytes contain the MBR while the rest > is the partition table. > > If you want the process to be repeatable what I would suggest is to > make your primary partition significantly less (say 50 megabytes or so > to be safe) than the smallest card you are likely to use. Around here > I cannot buy anything smaller than a 4 GB CF card so I make my system > images ~3.9 GB. > > At this point there are a couple of slightly different ways to go. > > First, you could backup the original card as you described below. > Then you partition the new card with fdisk/cfdisk/parted etc. You > then restore the MBR to the major device name (eg. /dev/sdc) inverting > the command you used to backup the MBR. You then restore the > partition back to the minor device name (eg. /dev/sdc1). At this > point you should be good to go. > > The second choice is to simply ddrescue one card over to the other. > If the destination is slightly smaller you may have to repair the > partition table but you should still be able to boot off the imaged > device. > > If you do this often enough, something like FOG might be useful to > image these systems with. We used to do this but we now deploy so few > that we just build again from scratch using the latest version of > voyage. We do very little customization as we use the Alix SBCs as > network appliances, so things like the firewall, traffic shaping, and > multipath routing take minutes to install (just bash scripts that we > put in /usr/local/ with symlinks to /etc/init.d) and usually > everything else we need is already on the system. > > Hope this helps! > > On Tue, Oct 11, 2011 at 4:33 PM, Emilio Arrufat <[email protected]> > wrote: > > Dear Gustin, > > my name is Emilio Arrufat, from Spain. I would apologize for any > > inconvenience for sending to you this message, but I would want to ask > > you about a procedure you wrote I have found on internet about > > duplicating Voyage in CF cards of different sizes. > > > > It solves many problems I was wondering about, in particular when I > > tried to duplicate a whole, say 1GB, card to another 1GB one I found > > what you mentioned: "If you want to backup the whole drive and you are > > sure that the drives are exactly the same (even though they are both 8 > > GB, they may not be exactly the same, down to the last byte), I > > usually just use ddrescue." My cards had different geometry and > > duplication did not work. So when I read from you "What I do is backup > > the MBR and partitions separately. " it sounded to me as my solution. > > > > However I have tried several times with no luck. Let me tell what I > > did and ask you if you can give me any advice: > > > > say my CF is /dev/sdc. First of all I formatted the first card with a > > size slightly minor than 1GB, not ocuppying the whole card, to avoid > > restoring on cards with a few less capacity. Installed Voyage and test > > it. > > > > Second I follow your procedure: 1) backed up the card MBR: dd > > if=/dev/sdc of=/path/to/alix.MBR.img count=1 bs=446 and 2) backed up > > the partition where Voyage is installed: ddrescue /dev/sdc1 > > /path/to/alix.sda1.img > > > > Third: I partitioned the second card with a partition expanding to the > > whole capacity (hope bigger size than first card) and restored the > > MBR: dd if=/path/to/alix.MBR.img of=/dev/sdc count=1 bs=446 and the > > partition of Voyage: ddrescue /path/to/alix.sda1.img /dev/sdc1 > > > > The restoring ended with no errors, but the OS does not boot up. I > > have tested it several times. > > > > Do you have any clue? > > > > I would appreciate your help, > > > > thanks in advance, > > > > Emilio Arrufat > > > > _______________________________________________ > Voyage-linux mailing list > [email protected] > http://list.voyage.hk/mailman/listinfo/voyage-linux > > > _______________________________________________ > Voyage-linux mailing list > [email protected] > http://list.voyage.hk/mailman/listinfo/voyage-linux > >
_______________________________________________ Voyage-linux mailing list [email protected] http://list.voyage.hk/mailman/listinfo/voyage-linux
