[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Live + installer + Usb key

On Tue, Nov 04, 2008 at 12:17:33AM +0100, Hans Ekbrand wrote:


> I think this is pretty straightforward (but I haven't tested it yet).
> The thing is that when you dd the binary.img to the usb-disk, e.g.
> dd if=binary.img of=/dev/sdb 
> you will get a /dev/sdb1 with the exact size of the binary.img
> Then you just need to create a new partition (/dev/sdb2) that uses up
> the rest of the usb-stick, and name that partition "live-rw". That
> should be possible with a sfdisk one-liner.

Here's a bash snippet for that (not a one-liner, though)


# Automatically add a partition which fills the rest of a debian-live usb-key
# usage:  auto-format device
# e.g. auto-format /dev/sdb


STARTSEC=`sfdisk -l $DEV | grep "*" | awk {'print $5'} | cut -d "-" -f 1`
echo -e ",$STARTSEC,L,*\n,,L\n" | sfdisk $DEV
mke2fs -L "live-rw" ${DEV}2 

Hans Ekbrand (http://sociologi.cjb.net) <hans@sociologi.cjb.net>
Q. What is that strange attachment in this mail?
A. My digital signature, see www.gnupg.org for info on how you could
   use it to ensure that this mail is from me and has not been
   altered on the way to you.

Attachment: signature.asc
Description: Digital signature

Reply to: