Date: Wed, 25 Mar 2009 21:57:27 +0000 (UTC) From: "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net> To: Marcel Moolenaar <xcllnt@mac.com> Cc: freebsd-geom@freebsd.org Subject: gpart on top of eli inside a slice is not working Message-ID: <20090325214318.Q67075@maildrop.int.zabbadoz.net>
next in thread | raw e-mail | index | archive | help
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1519328060-1238018247=:67075 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi, assume you get a laptop with the usual pre-install that you must not and cannot change but still want to add a freebsd to the wastefull emptyness at the end of the large disk. So you have 3 classic slices: 1 compaq recovery 2 ntfs 3 dos (free) So I tried to play a bit with that and tried to install freebsd on slice 3 inside eli. To try gjournal as well I thought I go with gpart directly as it will be the tool in the future instead od bsdlabel and created 3 paritions: 1 for the journal, 2 for swap and 2 for the data. All was fine. I rebooted. and there was garbage. Here=B4s a script to reproduce this on head. It will create a swap backed memory disk and a $0.key file. If unsure run the steps by hand to avoid the script accidentally go wild. It's quickly hacked together so it's not nice but did the job on a 8-current here. It does not yet create the journal or newfs anything as I tried the minimum to reproduce this. Leaving out the fdisk and the s=3D${md}s3 it will work fine. So I guess it a problem of stacking things. And before you are going to ask - changing slice 3 to 165 (freebsd) does not change anything. Any ideas? ----- 8< 8< 8<---------------------------------------------------------- #!/bin/sh case `id -u` in 0) ;; *) echo "Run as super user" >&2 exit 1 ;; esac md=3D`mdconfig -a -t swap -s 32901120 -x 63 -y 64` case "${md}" in md*) echo "Created swapped backed memory disk ${md}" ;; *) echo "ERROR creating memory disk">&2 exit 1 ;; esac echo =A8creating initial set=A8 echo " ..fdisk" # cannot get this to work fdisk -q -i -f - /dev/${md} <<EOFDISK # 80000 2 63 255 0 2048 0 g c4 h64 s63 p 1 18 63 3969 p 2 7 4095 3969 p 3 6 8064 44352 a 3 EOFDISK fdisk /dev/${md} # slice we use s=3D${md}s3 echo " ..eli key" dd if=3D/dev/random of=3D$0.key bs=3D64 count=3D1 echo " ..eli init, attach" geli init -s 4096 -P -K $0.key /dev/${s} geli attach -p -k $0.key /dev/${s} echo " ..part create,add,add,add,commit,show" gpart create -s GPT ${s}.eli gpart add -b 1024 -s 1024 -t freebsd-ufs /dev/${s}.eli gpart add -b 2048 -s 1024 -t freebsd-swap /dev/${s}.eli gpart add -b 3072 -s 2048 -t freebsd-ufs /dev/${s}.eli # just to be on the save side gpart commit ${s}.eli gpart show ${s}.eli echo " ..eli detach" geli detach /dev/${s}.eli echo =A8re-attaching and showing so you can compare=A8 geli attach -p -k $0.key /dev/${s} ls -l /dev/${md}* gpart show ${s}.eli geli detach /dev/${s}.eli echo "Cleaning up.." # mdconfig also accpets mdN as unit. mdconfig -d -u ${md} # end ----- 8< 8< 8<---------------------------------------------------------- /bz --=20 Bjoern A. Zeeb The greatest risk is not taking one. --0-1519328060-1238018247=:67075--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090325214318.Q67075>