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

Re: Live + installer + Usb key

On Wed, Nov 05, 2008 at 01:08:26AM +0100, Hans Ekbrand wrote:
> On Tue, Nov 04, 2008 at 12:17:33AM +0100, Hans Ekbrand wrote:
> Here's a bash snippet for that (not a one-liner, though)

Forget that one, here is a tested one, that uses sectors and takes
into account that the first partition does not start at sector 0

------------ start of script auto-format -------------------

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


START=`sfdisk -l -uS $DEV | grep "*" | awk {'print $3'} | cut -d "-" -f 1`
SIZE=`sfdisk -l -uS $DEV | grep "*" | awk {'print $5'} | cut -d "-" -f 1`
END=`sfdisk -l -uS $DEV | grep "*" | awk {'print $4'} | cut -d "-" -f 1`
let END=END+1

echo -e "${START},${SIZE},,*\n${END},,L\n" | sfdisk -uS $DEV
mke2fs -L "live-rw" ${DEV}2 

------------- end of auto-format ----------------------------

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: