LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   deleate extra operating systems (https://www.linuxquestions.org/questions/ubuntu-63/deleate-extra-operating-systems-754961/)

Randymanme 09-13-2009 10:37 PM

deleate extra operating systems
 
Compaq Presario 543OUS series 5000
Pentium ® 4 processor 1800 Hz
Processor speed 1800/400 Hz
Processor stepping F12
Cache size (L1/L2) 20/256 KB
RAM 256Mb; Clock 1.8 Gb
Hard Drive 30 Gb
16X Max* DVD-ROM; CD-RW
VGA compatible controller: nVidia Corporation NV11 [GeForce2 MX/MX 400] (rev b2)
Ubuntu 9.04; Ffx 3.5.3, Ffx 3.0.14; Chromium dev


I have 10 operating systems on my computer - all the same thing: Jaunty 9.04. Six are broken and two have graphics issues. I only want to keep one (and its recovery mate). How do I delete the others?

j_jerry 09-13-2009 11:02 PM

Boot through the ubuntu that you wanna keep, be root and delete all the other os' (they'd be on partitions other than your 'File System' )

After that edit your /boot/grub/menu.lst (to delete all the unwanted entries on system boot menu)

vishesh 09-13-2009 11:23 PM

Reformat or delete the partitions where your broken oses are present and remove entries from grub

thnks

Randymanme 09-14-2009 01:12 AM

Please assume that I know nothing. Precisely how do I do all that? I mean, like, hold my hand and walk me through step-by-step.

sonichedgehog 09-14-2009 03:09 AM

The step by step stuff is at http://www.dedoimedo.com/computers/g...mozTocId928352 and its great.

One point thats not obvious until you've got into trouble with it: the MBR (Master Boot Record) is the first bit of your master hard disk (as opposed to slave if you have others).

When you turn on the 1st software thats read is on your motherboard (ie the BIOS) that hands over to where you've told it to- eg CD if present, if not then to the MBR.

The MBR under GRUB is set up to pass the ball to wherever GRUB has told it to- and this is important- if you configured grub automatically, its the /boot/grub/menu.lst on whatever partition you last installed your root directory on. So when you add another linux OS, it rewrites the MBR to ignore the previous menu.lst and use the entries in the new one.

Grub will have detected all your other vmlinuz files and put them on as entries so it will seem to you that its simply added your new OS. No it hasn't. Its written a whole new menu.lst.

I'm about to do what you're doing. I have to delete an OS that I added later, so I'll be reverting to the menu.lst that was written earlier. The MBR will no longer refer to it. So if I just delete the partition, then afaik I can't boot automatically. EDIT: Have now completed the process.

What I have to do (and you as well I think) is this:
please don't try this until you have comments from LQ people who've done this successfully, I'm feeling my way here:study:EDIT: no, go ahead, just read on.


EDIT start with
Code:

fdisk -l
and make a note of all the partitions it shows you. This gives you the partition table before you weed out the partitions you don't want.
Deletion of partitions and moving/resizing the ones you are keeping takes ages. Get fully backed up first, you might lose all your data if power fails halfway through a move.
Then fdisk again to see the new table. You will find that eg sda7 is now sda4. THIS IS VERY IMPORTANT.

At this stage, grub will probably not work on reboot, because the entry in the MBR has probably either moved or no longer exists.

Into terminal, either sudo before each command or su root.
Code:

localhost# grub
grub> root(hd0,[number of the partition containing the valid menu.lst MINUS ONE]
grub> setup(hd0)
grub> quit

EDIT:before the root command, you could (from grub prompt)
Code:

find /boot/grub/stage1
. This will list any partition that has the menu.lst in the right place, in grub naming style. So /dev/sdb3 would be (hd1,2).


You can do this either from within your OS or from a live CD although the tutorial assumes that your OS is down, so you would have used a live CD to get in.

Watch that device drive protocol. Under /dev you will see hda1, hda2, or sda1, sda2 etc. In grub its hd0,0, hd0,1, whether its hd or sd.

Again a word of caution- I'm picking this stuff up from various sources and haven't had to do it for real- yet!EDIT
No, its done. Now the rest:
3 things:
1 You have to rewrite the MBR as above to point it to the correct MBR. The name of the valid partition might have changed.
2 menu.lst might now have incorrect references. Eg, if you have deleted a partition before the one that contains the kernel you are using, the /dev/sd[whatever] reference in menu.lst is now wrong. You need that sd number to give the device node that contains the kernel you want. I suggest that, while you are in a working OS, and after removing the redundant partitions, you get into the partition that you believe has the OS you want. You might need to mount it- please read up elsewhere how to do that. When you are sure, write down the device node (the /dev/sd{} entry) and convert it to grub style (hd{},{}), you will need both in order to correct menu.lst. Again, I would recommend you backup the menu.lst before altering it. And use vim or gedit. If not sure, research this first.
3 You might find that the partition containing your home files has gone. All that has happened, in fact, is that the "mount point" remains (/home/yourname) but the partition has a different name! So you need to go to /etc/fstab and change the line that contains the wrong mount information. if it read /dev/sda8 before, it might need, eg, /dev/sda6 now. That's why you need to make a note of the correct partition name.
I hope this helps you and anyone else looking for this information.


All times are GMT -5. The time now is 05:56 AM.