A question about burning USB stick

Nils Kassube kassube at gmx.net
Tue Jan 11 13:06:35 UTC 2011


Amedee Van Gasse wrote:
> On Sat, January 8, 2011 10:38, Nils Kassube wrote:
> > Just a side note: I have two 4GB CF cards of the same model which
> > have a slightly different number of tracks announced to the
> > kernel. I only noticed this fact when I wanted to make a clone of
> > one card (the one with more tracks) to the other one. Therefore I
> > now make the last partition slightly smaller than possible. Then
> > there are no data lost on the last tracks if I ever have to
> > restore a backup to a new card.
> 
> I understand the problem and your solution, but maybe this is only a
> concern if the partition is almost full? If the filesystem doesn't
> fit on the card, wouldn't fsck fix that?

I think that depends on the position where your remaining data are 
stored. If they are at the beginning, everything is fine but if they are 
at the end, you're not so lucky. While fsck would repair the file 
system, it can't restore the data from the last track(s) which are not 
on the new device. Furthermore the partition table still has the entry 
with the wrong size, so fdisk (or something like gparted) should be used 
before fsck to repair the partition table.

> I always fill up my sticks with nulls (dd if=/dev/null
> of=/media/stick/delete bs=1M && sync && sync && sync && rm
> /media/stick/delete && sync && sync && sync) before I dd them to an
> image.

That's a good idea, especially if the image should be compressed. Oh, 
BTW: It should be /dev/zero instead of /dev/null.

> If I was extra paranoid, I could copy all files to my hard
> disk, delete them from the stick, and then copy them back. That way
> I would be 100% sure that there was no fragmentation.

Yes, that should be safe (except the wrong size in the partition table).

Now that I think about it, there is another idea. Next time I'll put the 
swap partition at the end. There are no data on that partition which 
should be preserved for a backup and if the space on a new device is 
smaller, I could just remove the partition and make a new one.


Nils




More information about the ubuntu-users mailing list