LinHES Forums
http://forum.linhes.org/

Can install skip existing partition?
http://forum.linhes.org/viewtopic.php?f=6&t=1110
Page 1 of 1

Author:  jpummill2 [ Wed Mar 31, 2004 2:39 pm ]
Post subject:  Can install skip existing partition?

Hi All,

I am going to set up a dual boot machine with windows 2000, and knoppmyth. I have run into the same problems as others in this forum who have gone before me.

I was wondering how hard it would be for the auto-installer to realize that there is already an existing partition and skip it when creating the new partitions for root, swap, and myth.

Just curious.

jpummill

P.S. I don't mean to ask cesman to do all the work. I am looking at the KnoppMyth- files in /KNOPPIX/usr/local/bin now to see if this is a change I can help with. Just not sure I am up to the challenge is all. And I did not want to reinvent the wheel if someone else had already done this.

Author:  jpummill2 [ Thu Apr 01, 2004 4:36 pm ]
Post subject: 

Ok, I am sure there is a lot more to this than I am seeing now but here is the code to pertition the disk.

I am thinking we could switch root to partition 2, swap to partition 3, and myth could be partition 4. Cache could just be a subdirectory under myth (any reason why they are on seperate partitons??? Not for performance since it ts the same disk!!!)

Has anyone else looked at the code enough to know where else we would need to make changes (ie. What else this breaks...)

Also, on a side note, if I change KnoppMyth-auto and would like to create a new bootable CD with my code, how do I go about doing that?

Thanks for any insight,
jpummill

The code:
--------------------------------------------------------------------------------
function partition_autosize() {
# preliminary:
DEV=${HD_CHOICE%%[0-9]*} # if /dev/hda1
ROOT_PART=${HD_CHOICE#${DEV}} # then 1
SIZE=$(fdisk -l $DEV 2>&1 | grep "^Disk ${DEV}: " | awk '{print $5}')
DISK_SIZE=$[$SIZE / 1000000]

# Autosizing:
MEM=$(grep '^Mem: ' /proc/meminfo | awk '{print $2}')
MEM_TOTAL=$[$MEM/1000000]
[ $MEM_TOTAL -gt 900 ] && MEM_TOTAL=900 # 900M is enough.
SZ1=$[$ROOT_MIN_CORR * 120 / 100] # add 20% spare
SZ1=$[500 + $SZ1 + $DISK_SIZE / 100] # part 1 size, MB
SZ2=$[1000 - $MEM_TOTAL + $DISK_SIZE / 500] # part 2 size, MB
SZ3=$[2000 + $DISK_SIZE / 20] # part 3 size, MB
[ $SZ2 -gt 1200 ] && SZ2=1200 # max size of swap
[ $SZ2 -lt 120 ] && SZ2=120 # min size of swap
SZ3=$[(($SZ3 + 500) / 1000) * 1075] # resize to multiple of 1G
}

# Note: Here is hardcoded the use of ${DEV}1 for root, 2 for swap, etc
function module_do_partition
{
# Autosizing:
partition_autosize

swapoff -a >& /dev/null
update_status $"Partitioning $DEV..."
dd if=/dev/zero of=$DEV bs=1k count=16 >& $LOGE

logit $"starting fdisk for $DEV ${SZ1}M ${SZ2}M ${SZ3}M"
STR1="n\np\n1\n\n+${SZ1}M\n" # partition 1
STR2="n\np\n2\n\n+${SZ2}M\nt\n2\n82\n" # partition 2
STR3="n\np\n3\n\n+${SZ3}M\n" # partition 3
STR4="n\np\n4\n\n\nw\nq\n" # partition 4
echo -e "${STR1}${STR2}${STR3}${STR4}" | \
fdisk "$DEV" >& /$TMPDIR/fdisk.out
logit $"finish fdisk"
}

function module_do_swap
{
DEV=${HD_CHOICE%?}2 # << hard coded as partition 2
if [ -z "SWAP_CHOICES" ]; then
SWAP_CHOICES="$DEV"
SWAP_AUTODETECT="no"
fi
update_status $"Adding swap on $DEV..."
mkswap $DEV >& $TMPDIR/mkswap.out
sleep 1
swapon $DEV
}

Author:  jpummill2 [ Thu Apr 01, 2004 4:39 pm ]
Post subject: 

Also, I echo to a file the values from the variables in the included code section. I have a 6 gig disk, and 328 meg of memory on my machine. Here are the results:
----------------------------------------------------------------------------

DEV=/dev/hda
ROOT_PART=1
SIZE=6448619520
DISK_SIZE=6448

MEM=329195520
MEM_TOTAL=329
MEM_TOTAL_900_MAX=329
SZ1=0
SZ1=564
SZ2=683
SZ3=2322
SZ2_MAX_1200=683
SZ2_MIN_120=683
SZ3_MULTIPLE_1G=2150

Hope this helps anyone who is interested,
jpummill

Author:  syversen [ Sat Apr 10, 2004 9:01 pm ]
Post subject:  Cool!

jpummill,

That's awesome that you are working on that. I've also been trying to fix the Knoppmyth installation to address the dual boot problem. (Also with Win2k). You can see the latest link on the subject where I include some possible solutions:

http://mysettopbox.tv/phpBB2/viewtopic.php?t=771

I've got a copy of the install script if you don't already have it. (Sounds like you've already got it though!) I'm coming at it from another angle, trying to fix the manual partitioning options. I like your approach better though, I'd love to just keep the auto-install and have it skip hda1 if it could.

Did you have any luck fixing that yet? Have you even figured out a good way to test it? (Do you have to burn a new ISO each iteration you want to test?) I've done like 10 lines of Bash scripting in my life, so I'm sure the syntax would take me a while.

- Jason

Author:  jpummill2 [ Mon Apr 12, 2004 9:21 am ]
Post subject: 

Still working on it. The script is more convoluted than I originally thought.

I have burned one new distro cd but just for testing. I made some mistakes so I am retesting changes in a new auto installer called KnoppMyth-dualauto before I burn another test iso.

If I can get it working, I will send it to cesman for inclusion in a future version of KnoppMyth (If he will have it :)

jpummill

Author:  cesman [ Mon Apr 12, 2004 10:22 am ]
Post subject: 

Isn't it fun making a CD to fine out you've made a mistake somewhere and have to do it all over again!

Author:  syversen [ Tue Apr 13, 2004 7:56 am ]
Post subject:  Not the first time...

I get the feeling that it wouldn't the first time that's happened to you, eh Cecil? :-)

Any word from Dale regarding the fix to the manual partitioning path? I got your email but there is a pretty high chance that any changes I make will have a syntax bug and having your burn an ISO as is seems a little too inefficient... A friend of mine who's a Bash guy is going to look it over and give me some feedback, maybe after that I'll submit it.

- Jason

Author:  khrusher [ Tue Apr 13, 2004 7:02 pm ]
Post subject:  newbie following thread with intrst

I have just fallen onto this site and PVR PC's in general. I have an extra PC that is very lightly used. It has Dell installed XP on its only disk 40 GB.

I'd like to keep the XP on the PC in the off change that Im not happy w/ myth (I know....how could that happen.)

The disk has many GB free. Im gonna list some questions.

Is there anyway to use 1/2 of the existing disk (leaving XP) for knoppmyth?
should I buy a second disk?
If I get a second disk, would it be easier/safer to take the disk w/ XP out and replacy w/ the new disk and do an 'auto-install' or is there a chance the install script will be able to skip the first disk.

Is there a way to make the existing disk (w/XP) the second disk, install myth on the (new) first disk and still be able to boot to either?

Thanx,
Chris

Author:  cesman [ Tue Apr 13, 2004 7:56 pm ]
Post subject: 

I personally don't think 20 gigs is enough for a PVR. Get a second hard drive, take the drive w/ XP. Do an auto-install on the first. Once you have KnoppMyth installed, you can put the other drive back in and use a boot manager to select this drive to want to boot to. NOTE:If you move KnoppMyth to primary slave, change /etc/lilo and fstab accordingly. Don't forget to run lilo afterward. This can be dont before you change the drive or after(boot from CD and chroot).

Author:  khrusher [ Wed Apr 14, 2004 6:27 am ]
Post subject: 

perfect...that's what I wanted to hear. Cant hurt the XP partition if its on in the box. :D

Author:  pepe [ Tue Jun 08, 2004 12:03 am ]
Post subject: 

I'm trying to dual boot also. (games!)

Will winxp boot off an external usb drive? I don't want to buy one if it won't work. I don't know how I would specify that to LILO... maybe I'd have to install lilo on the external drive, set the bios to boot from there (if it can.. I should check that) and .. well. I'd be interested to hear if anyone else has put windows on an external drive for the rare game-play.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/