Announcement

Collapse
No announcement yet.

What happens if you delete the swap or /home partition? [SOLVED]

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    What happens if you delete the swap or /home partition? [SOLVED]

    Yesterday I tried to reinstall Windows XP on my multi-boot system (Win XP and Kubuntu 8.10) but things went horribly wrong. Windows has obliterated my MBR, which formerly kicked off a GRUB menu letting me choose which OS to boot. What's worse, during the Windows XP install process, I was told I had "too many partitions" and that Setup could not create a partition to install XP on. Which is freaking great, since I had JUST deleted my Win XP partition, planning to reformat it before continuing to install.

    So now I can't boot that machine at all.

    The machine only has one hard drive, and it's partitioned like this:

    one NTFS partition, used to store data
    one ext3 partition, containing my Kubuntu 8.10 install
    one ext3 partition, containing my /home for Kubuntu 8.10
    one Linux swap partition

    Apparently, that's one partition too many; Windows XP setup freaks out if it sees more than 3 partitions, be they primary or otherwise. So I have to get rid of one.

    The NTFS partition contains data I'd rather not lose. There's nothing really special in my /home folder, and in any case it's backed up on my NTFS data partition.

    So which one should I delete? What happens if I delete the Linux swap partition? The /home partition?

    Is there any way to fix the MBR so that GRUB can start Kubuntu 8.10 again? I've tried running the Kubuntu 8.10 live CD, but there are two problems:

    1) There's this weird bug where it turns off the display 5-10 minutes after getting to the desktop,
    2) When I install gparted, it does not show any partitions at all on the hard drive, just sees it as one large disk (it's a 1 TB drive, so it's 900-something GB).

    At the same time, the file manager has no problem seeing the existing partitions, mounting them, and reading/writing to them. So, I can't simply use gparted to create the required NTFS partition to install WinXP, which was my first thought.

    #2
    Re: What happens if you delete the swap or /home partition?

    I advice you to delete the Swap partition. Kubuntu should work without it. You won't loose any important data contrary to /home or / where you lose your personal data and your system data. The swap is, if my understanding of it is correct similar to RAM. Windows and MAC OS have swap also, but instead of partition it's a file...
    And instead of using gparted from your Kubuntu download the gParted live CD. Only thing you'll have to check is how much is your swap.
    Given that you have 1TB disk it might be big enough to fit the XP on it, but If it's not the use the gParted Live CD to resize the partition (the one that has most free space) and format that space into NTFS.
    Hope that helps.
    I'm magnet for errors, problems and bugs...

    Comment


      #3
      Re: What happens if you delete the swap or /home partition?

      Your swap partition is the best candidate for deletion. If you boot without it, you'll get a "Fail" during the "activating swap" boot stage but nothing else. As Primoz saysl, providing you have enough physical RAM (512MB is more than enough), your machine will boot without problems.

      An "idle" Linux system is at any point using some kernel memory and some user memory. The physical memory that remains unused is assigned to the disk cache pool. By the way, I've read comments of people complaining how inefficient Linux is because it does not use all your physical memory. This is a confusion, Linux always uses for disk caché the memory that is not being used by user or kernel tasks, but "other" OSes (Windows) report total memory usage including the disk caché.

      However, if you start opening too many applications you'll eat up your physical RAM. When additional memory is requested, Linux removes some of them from the disk caché memory pool. When that is exhausted, Linux starts to page out to swap. Without swap, it starts to discard portions of read-only executable code and loads them again on demand from the filesystem. This amounts to swapping but way, way slower. If you keep launching apps, there will be a point where the system becomes unusable (has happened to me) At least that's the default behaviour that I've seen.

      Deleting /home partition would allow you to install Windows, but would render the Ubuntu install much problematic to use I hate to configure again applications and remember my passwords,etc, so that would be my last option.

      In your case, I'd try to follow this plan:

      1- Boot with the Ubuntu install CD in rescue mode and restore the MBR so that you're able to boot Ubuntu.
      2- Delete the swap partition
      3- Re-create the XP partition you deleted and, install the "lesser" operating system and let him do its thing with the MBR.
      4- Boot with the Ubuntu install CD in rescue mode and update the MBR so that you're able to boot other, superior operating systems as well.
      5- Create the swap partition again and configure it in fstab.

      Until you restore the swap configuration, I'd be careful on not running out of physical memory while running Ubuntu. You don't need to delete the swap partition to check how Ubuntu runs without it, it's enough to comment the entry in /etc/fstab and reboot or swapoff -a

      Now, and excuse for the long rant, about your specific comments

      1) There's this weird bug where it turns off the display 5-10 minutes after getting to the desktop,
      Never heard of that one, are you sure it's not the screensaver kicking (or trying to kick in)?

      2) When I install gparted, it does not show any partitions at all on the hard drive, just sees it as one large disk (it's a 1 TB drive, so it's 900-something GB).
      With the method outlined above, you can create the XP partition during the XP install. The only remaining problem would be the deletion of your current swap partition. Have you tried the fdisk program in the Ubuntu CD booting in "Rescue" mode? Running the fdisk command and giving the device node (/dev/sda in my case) and then typing "p" will list your partitions. If they appear there you can delete the one that is being used for swap. That way you'll not need the parted program.

      Another question comes to my mind, how you deleted the XP partition? If parted does not handle your disk, you certainly had an utility that did, or you would not have deleted the XP partition....

      Comment


        #4
        Re: What happens if you delete the swap or /home partition?

        I deleted the Windows partition using the Windows XP Setup program. It's actually an application called "DISKPART" which you can invoke from the Windows Recovery Console after you boot with the Windows XP install CDROM. However, it is clearly a very limited and weak app, since it freaks out if it sees more than 4 partitions (whether extended or primary, it doesn't seem to differentiate).

        I think I'll try the "delete swap partition" approach. It sounds very much like I never needed a swap partition in the first place. Because I chose the 64-bit version of Intrepid Ibex, I should be able to use every last bit of my 4 GB RAM, so a disk swap file ought to be unnecessary.

        Update: Tried the above. I still can't boot my Kubuntu install, no way, no how. I don't have the Ubuntu disc, and the Kubuntu live DVD doesn't have the "rescue mode" feature.

        However, I did get Win XP reinstalled, but it did something really annoying: put several startup files (boot.ini, ntldr, ntdetect.com etc.) on the existing NTFS partition, which I specifically did NOT want to write anything to! It put the rest of itself in the proper place, a 20 GB NTFS partition I created in the free space.

        So now I have a dorked up Win XP install, and I still can't boot Kubuntu.

        SIGH. At least I can get to the files on both NTFS partitions, so I can back up what was on my "data" partition, delete both NTFS partitions, and start over.

        I would also like to let GRUB reinsert itself in the MBR so I can boot Kubuntu or Windows selectively. Is there some other way to do that? I don't want to wait half a day to download & burn a copy of the Ubuntu install CD just to use one feature.

        Comment


          #5
          Re: What happens if you delete the swap or /home partition?

          Are you sure you operate diskpart the right way? Not to say that you're not right about this, but usually the M$ command line tools are not THAT buggy.

          Maybe you can create partitions and then have XP run the install?
          Code:
          create partition extended
          create partition logical size=5000
          create partition logical size=10000
          This should create an extended partition (provided you have some non-partitioned space) with two logical partitions. If you want only one logical, omit the size parameter.
          Once your problem is solved please edit the first post of your topic and add [SOLVED] in front of the subject. In that way, others can benefit from your experience!

          Comment


            #6
            Re: What happens if you delete the swap or /home partition?

            My Linux partitions (home, root, swap) were all within an extended partition. I'm not sure why Win XP setup got confused & thought there were already 4 primary partitions.

            Anyway, Windows is sorta fixed for now, but I still can't boot my Kubuntu install. I can see the partitions properly under a live environment, e.g. Kubuntu live CD, but can't boot the install that's there. All the files are intact, but I don't know how to rewrite the MBR (or whatever it is I need to do) so that the computer boots to the GRUB menu instead of going straight for Windows. I tried simply flagging the Kubuntu / partition as the boot volume in gparted, but it didn't work. I got some kind of "file not found" error.

            Comment


              #7
              Re: What happens if you delete the swap or /home partition?

              Boot from the LiveCD

              open a command prompt and enter:
              Code:
              grub
              This starts grub, then enter:
              Code:
              root(hd0,2) 
              setup (hd0)
              assuming that your linux installation is indeed at hd0,2 and that you want to write the MBR to hd0
              Once your problem is solved please edit the first post of your topic and add [SOLVED] in front of the subject. In that way, others can benefit from your experience!

              Comment


                #8
                Re: What happens if you delete the swap or /home partition?

                Alternatively you could run the kubutu installation program again which will reinstate grub and (assuming you did delete your swap file) you could reinstate that too.

                Comment


                  #9
                  Re: What happens if you delete the swap or /home partition?

                  Wouldn't re-running the Kubuntu install wipe my existing install? I have a certain set of apps, settings, etc. that I'm rather fond of.

                  Also, if I really want to have a swap partition, couldn't I just use gparted to make a Linux swap partition in the free space? Only trick then would be getting the OS to use it, should it ever need disk swap space - not sure how to do that.

                  Comment


                    #10
                    Re: What happens if you delete the swap or /home partition?

                    A simpler approach may be to download a super grub disk from www.supergrubdisk.org/

                    This disk is a great recovery tool when the mbr gets clobbered.

                    Comment


                      #11
                      Re: What happens if you delete the swap or /home partition?

                      If you have a separate home partition, no, unless you elect to format it during the reinstall. Your settings would be retained. It would replace your installed applications of course, which are in the root folder. It would replace the MBR and would also be a handy way of assigning mount points to the various partitions. if those have been messed up. Certainly setting up a partition as swap during installation is a pretty foolproof way of making sure the OS used it.

                      Can I ask to what extent you are running windows nowadays? If you are like me, and you now only use it for specific, limited, purposes, then running it in a VM might be a viable option.

                      Ian

                      Comment


                        #12
                        Re: What happens if you delete the swap or /home partition?

                        Congratulations, Objekt, you're halfway there!!! At least you're able to boot Windows. Now, you could follow my original plan or another idea I had while reading the rest of this thread. You could also boot now Ubuntu from Windows boot manager by adding a line to XP's boot.ini file. I've never done it but it certainly can be done.

                        And excuse my lousy memory, yes, the installation CD does not have a "rescue" option. But you can boot with the live CD with the same effect.

                        While it's true that reinstalling will correctly set up your partitions, swap, etc in fstab as well as grub in the MBR, I think that you could achieve the same effect by using grub from the live CD as outlined by JohanLingen. If grub's menu.lst is no longer valid because you've shuffled partitions you'll have to change that file using the live CD. If some of your partitions do not get mounted correctly during boot, you will have to edit the fstab file of your existing installation by hand, again booting from the live.

                        However, if you don't feel at home hand editing config files it perhaps is better that you go to the reinstall option. But other than that I don't see any other problems that you could have, and it could be much faster than reinstalling again. If you're like me, you'll save also a few moments during the next few weeks trying to remember all the packages that you had installed that were not part of the standard CD.

                        And as suggested by Liquidator, if you use Windows only for non-graphic things (games, Photoshop) you could consider wiping it out entirely and installing it under VirtualBox.

                        Comment


                          #13
                          Re: What happens if you delete the swap or /home partition?

                          I got Kubuntu booting again and Grub's in charge at boot time, as it should be and as I had it before.

                          It was as simple as reinstalling Grub to the MBR, with command such as "root (hd0,1)" and "setup(hd0)." Once I did that, I was on my way. I think getting Windows XP reinstalled was key, as it seems to have resolved whatever partition table troubles were keeping tools such as gparted from seeing things properly.

                          (Note that I had to delete one of my NTFS partitions for Wind XP to install at all, thus the Kubuntu / partition became partition 1, instead of 2; Windows is of course partition 0 on hd0.)

                          After that, on startup I got the Grub menu I used to get before all these shenanigans occurred.

                          By the way, I found it wasn't possible to do the Grub commands under a live CD environment. When I tried, I received a message that I did not have the proper privileges, and "this incident will be reported." This is typical when you try to sudo but aren't in the sudoers group. You need to sudo for grub to work, so it was a no-go. I found it was necessary to instead boot up a rescue-type live CD. In particular, I used the Partition Magic distro.

                          I had tried Super GRUB 0.9730 earlier, but none of its options worked. Again, I think this was because Windows had partially trashed the partition table, at least to the point that Linux-based tools could not always read it properly.

                          Comment


                            #14
                            Re: What happens if you delete the swap or /home partition? [SOLVED]

                            Congratulations Objekct, seems that you've solved all your problems. I don't think that XP reinstall has contributed to fix your partition by itself, probably partitioning with any other tool (for example, the included in Ubuntu, fdisk) would have solved it.

                            Next time you try to run a command as root from the live CD, tryputting "sudo" before the command. Surely worked for me.

                            Comment


                              #15
                              Re: What happens if you delete the swap or /home partition? [SOLVED]

                              barbolani: "Next time you try to run a command as root from the live CD, tryputting "sudo" before the command. Surely worked for me."

                              Yes, I agree --
                              sudo grub
                              always works for me from Live Kubuntu CD.

                              somehow, I missed this whole thread -- probably a blessing for Objekt, staying out of his way so he could do his work
                              An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                              Comment

                              Working...
                              X