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 ------------------- #/bin/bash # Automatically add a partition which fills the rest of a debian-live usb-key # usage: auto-format device # e.g. auto-format /dev/sdb DEV=$1 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) <[EMAIL PROTECTED]> 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.
signature.asc
Description: Digital signature