Adding an OS

I’m running SUSE as my main OS, with XP Pro installed into a Virtualbox VM (I need it for my college work). I’m having some issues getting my laptop bluetooth to be recognised, and the VM XP isn’t recognising it either. I thought I might reinstall Windows as a dual boot setup, temporarily, just to see whether it detects the bluetooth adapter when its installed as a standalone OS (not running in a VM).

Question …

What is the easiest and safest way to do this, without screwing up my SUSE installation, or breaking Grub? XP is going to want the first partition (I only have one drive), so I’ll have to resize things and move my SUSE stuff further down the drive. My biggest concern is how to do this without losing the ability to boot SUSE.

Can someone please give me some tips on how best to do this?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can backup your MBR and rewrite it after the windows install but
windows will always break any other boot loaders you have. This may help:

http://linuxpoison.blogspot.com/2007/11/backup-and-restore-mbr-after-windows.html

Good luck.

justakiwi wrote:
| I’m running SUSE as my main OS, with XP Pro installed into a Virtualbox
| VM (I need it for my college work). I’m having some issues getting my
| laptop bluetooth to be recognised, and the VM XP isn’t recognising it
| either. I thought I might reinstall Windows as a dual boot setup,
| temporarily, just to see whether it detects the bluetooth adapter when
| its installed as a standalone OS (not running in a VM).
|
| Question …
|
| What is the easiest and safest way to do this, without screwing up my
| SUSE installation, or breaking Grub? XP is going to want the first
| partition (I only have one drive), so I’ll have to resize things and
| move my SUSE stuff further down the drive. My biggest concern is how to
| do this without losing the ability to boot SUSE.
|
| Can someone please give me some tips on how best to do this?
|
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIUf033s42bA80+9kRAlOyAJ9fx3s2gFv+r5Xn1pE8ksssMvbjlQCdEbFU
R8E9DAMJVMCmiDUZA6lWpg0=
=6llQ
-----END PGP SIGNATURE-----

you seem to have a pretty good idea of what’s going on anyway, your partitioning idea is good, let windows have partition 1 (so hd 0,0). what suse are you using? if 10.3 the repair function is broken, but any other version use this, it will detect a boot loader error. but if using 10.3 it’s a fairly simple recovery, you will need a copy of super grub disk. if this is the case, let me know, i have the link somewhere to a very good how to on recovering grub i can find if you need it.

hope this helps.

Further to what thestig noted, workaround help for repairing an over-written Grub boot manager on openSUSE-10.3 can be found here: SDB:Howto repair boot manager Grub on opensuse 10.3 - openSUSE

I have not tried this work around myself.

I think your big difficulty will be that Linux will balk at the file system table that it reads as it boots. For example if you have root, home and swap respectively in sda1, sda2 and sda3. Then after you repartition they’ll be different in real life, but not in the file system table which is located at /etc/fstab. That’s a much bigger problem than grub IMHO. Grub can be easily repaired once you can boot into the Suse install off of the DVD. But with fstab mucked and Suse 10.3’s automatic repair facility broken from the day it was released, you’ve got probs, big probs from fstab.

Can you please cat /etc/fstab in a console and copy/paste the results here so we can suggest how you might edit it so you can get back into Suse after the partition surgery.

PS here’s a HowTo recover grub once you can boot from the dvdv into Suse: GRUB Boot Multiboot openSUSE Windows (2000, XP, Vista) using the Grub bootloader.

Ah, you’re right - I never thought of that.

Grub can be easily repaired once you can boot into the Suse install off of the DVD. But with fstab mucked and Suse 10.3’s automatic repair facility broken from the day it was released, you’ve got probs, big probs from fstab.

Can you please cat /etc/fstab in a console and copy/paste the results here so we can suggest how you might edit it so you can get back into Suse after the partition surgery.


carren@xxxxxxxx:~> cat /etc/fstab
/dev/disk/by-id/scsi-SATA_ST96812A_5PJ515K1-part2 /                    ext3                       acl,user_xattr        1 1
/dev/disk/by-id/scsi-SATA_ST96812A_5PJ515K1-part3 /home                ext3                       acl,user_xattr        1 2
/dev/disk/by-id/scsi-SATA_ST96812A_5PJ515K1-part1 swap                 swap                       defaults              0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
#none                /proc/bus/usb         usbfs      devgid=108,devmode=664 0 0
/dev/bus/usb         /proc/bus/usb         usbfs   defaults,devmode=660,devgid=1  


Oh, yeah, it’s 10.3.

Oh joy, you are saved by happy coincidence – should be no problem at all!

Step 1: moving the swap partition: reboot and log on as root rather than yourself and use the Yast partitioner to shrink /home partition 3 by the size of the swap partition (currently partition 1). Then create a new partition with format “swap” in the vacant space. Then unmount partition 1 as swap and mount the new partition at the end as the new swap. Then format the old swap partition 1 as fat32 but don’t mount it (just to make it recognisable to the windows installer later). The point of all this is that Suse will then be happy when you install some windows on the new partition 1. (it’s not big enough yet, but this is a start).

I’m coming back to write step 2 which is the resizing of the partitions to make bigger space for windows, but I have to go for a while and don’t want to lose this typing. Back later

Swerdna

Step 2: Back up everything that’s important under /home.

Best to do the lot because that will transfer/keep all your settings.

If you don’t know a good or favourite way to do that you might use this: Create a storage directory somewhere at /pathto/storage. Open the console and enter su to get root powers. Then this command in a console will preserve the ownerships and permissions for you:
cp -a /home/* /pathto/storage/

Step 3: Resize the partitions for windows

Figure out what you want for spacings for windows (part 1) root (part 2) home (part 3) and swap (part 4). Then download gparted on a cd. That’s a GUI partitioner that allows resizing of partitions. It’s on system rescue cd here: Download - SystemRescueCd. Burn that and boot off of it. When it settles down enter the command startx to get XWindows. gparted is started from the console in the GUI with command gparted. Or there’s an icon for Gparted.

R-click on partition 4 (maybe that’s the right size so R-click partition 3) and select resize. Change the “free space preceding” until the partition has the size you want.
R-click on partition before the one you just did and select resize. make the free space after to zero and the free space before to make the net result size what you want.
Do the next the same way
The last will be to resize the fat32 partition to the size you want for windows
Click “apply” and hold your breath.

Reboot and see if you can still boot to suse

I’ll be back later with step 4 – more extrernal duties call me

Step 5: install windows
Boot off the win instyall cd and select install. Use windows partitioner to delete the first partition and then remake it as ntfs and install windows on it. The Fat32 is just a placeholder and you can’t trust a partition made in Linux for windows so remake it ntfs.

Step 6: Fix the bootloader
As noted by OP the grub boot will have been overwritten. Boot back to Suse from the Suse install CD. Goto Yast → system → bootloader and select → other → propose new comnfiguration → wait for hourglass to stop spinning → boot loader installation → put the X in “boot from the master boot record” and un-check any others that might be X → finish. → Reboot and it will have been restored with windows in the list of options.

If you need to read more about simple Grub repair read this:
GRUB Boot Multiboot openSUSE Windows (2000, XP, Vista) using the Grub bootloader.

Luck

now that, swerdna, was good advice/tips…maybe add it to wiki somewhere if that’s not around, would help a lot of people perhaps?

can’t believe i only thought of grub as problem, and disregarded fstab entries :o

Are you serious? You want me to write something that might cause more installations of windows? Shame on you thestig :eek:

Many, many thanks! :slight_smile:

I think I can handle it but it might be a few days before I have a quiet, uninterrupted moment to do it.

The only thing I’m not sure about is unmounting /swap in Step 1. I had a quick look at the Yast partitioner (ran through it without making any changes) but I didn’t see an option for “don’t mount” anywhere. How do I tell that existing /swap partition to be not mounted, before setting the new /swap up?

BTW, probably a really stupid question, but why can’t I do the remaining partitioning/re-sizing steps via the Yast partitioner too, rather than GParted? I am familiar with GParted and have no problem using it, but I just wondered why I can’t do it via Yast?

swapoff -a seems to do it but you should be able to do it with the partion manager in yast to, or comment out the swap line in fstab.

In regards to resizing I have little experience with gparted as I normally resort to a live distro. If ext3 I do know I have to turn of the journal, in essence making a ext2 part before resizing. If you do this you can do it with yast but you need to make sure the partion you’re resizing isn’t mounted which if root can be problematic.

In Yast partitioner, highlight the old swap and click to Edit it and delete the word swap from the area called Mount Point

That’s actually an astute question. You can’t safely alter a dynamic, changing partition, you have to unmount them first. Of course the only way to get to an unmounted root partition is from another operating system like Gentoo Linux on systemrescuecd. Similarly /home.

haha, fair point. i think it still may be useful… some new comers to linux install linux and wipe over windows and want windows there still, so maybe this would be useful for them?? personally i love not having windows?

There may be value in an article on HowTo install windows after openSUSE. The repartitioning would be part of that. But let’s see if this works for justakiwi. Just one slip and the slate gets cleaned