LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can I give Windows full hard drive back after partitioning? (https://www.linuxquestions.org/questions/linux-newbie-8/can-i-give-windows-full-hard-drive-back-after-partitioning-4175445384/)

schtocker 01-13-2013 05:32 AM

Can I give Windows full hard drive back after partitioning?
 
Hello all; I'm a total Linux newbie, and I'm about to install Linux for the first time (for extra info, I'm installing Pinguy OS 12.04 on a HP Folio 13 which has Windows 7 preinstalled). After doing lots of reading and researching I'm going to partition my hard drive (I think!!)between Pinguy and Windows, but give Pinguy the vast majority. However, thinking into the future, I might one day want to sell this laptop and because the mass market is Windows, I'll want to have Windows installed on it. Now, once I've partitioned my hard drive, will there ever be a way to remove Pinguy AND give Windows the entire hard drive again?

EricTRA 01-13-2013 05:37 AM

Hello and welcome to LinuxQuestions,

The most logical first step would be to resize the Windows partition from within Windows itself so that the rest of the disk becomes available. Then you can install your Linux distribution onto that free diskspace, partitioning it like you want or need to. Once you want to go back, you can delete the Linux partitions which would indicate the recovered space as free disk space. And then from within Windows you could resize the Windows partition to occupy the full disk once again.

Be careful though! If you damage the Windows partition then you'll have to re-install from scratch. Make sure to make a complete backup of your disk (including partitions) with a tool like CloneZilla for example. That way if something goes wrong you can always revert to that backup.

Looking forward to your participation in the forums. Have fun with Linux.

Kind regards,

Eric

TroN-0074 01-13-2013 07:08 AM

I think in windows there is a key combination to bring the computer to its orinal stage which you would do anyway before selling or given it to another person. Anyway when you do that windows removes any partition you had manually added
Good look to you

johnsfine 01-13-2013 07:12 AM

Quote:

Originally Posted by schtocker (Post 4868883)
I'm going to partition my hard drive (I think!!)between Pinguy and Windows, but give Pinguy the vast majority.

Quote:

Originally Posted by EricTRA (Post 4868886)
The most logical first step would be to resize the Windows partition from within Windows itself

If you want to shrink the Windows partition by a large amount, it is best to disable the paging file before shrinking the partition and reenable it later. I provided more detail in this earlier post:
http://www.linuxquestions.org/questi...9/#post4841162

Quote:

Originally Posted by schtocker (Post 4868883)
Now, once I've partitioned my hard drive, will there ever be a way to remove Pinguy AND give Windows the entire hard drive again?

When you install Linux, it is typical and easiest to install the first stage of grub (the Linux boot loader) into the MBR, so the dual boot is controlled by grub. When you want to uninstall Linux, you should fix the MBR back to Windows-only before you delete the Linux partition. There are Windows programs available to fix the MBR. You could research the details of doing that before installing Linux if you are paranoid enough, or wait until you decide to uninstall Linux.

So your three steps to uninstalling Linux are:
1) Fix the MBR for Windows
2) Delete the Linux partitions
3) Grow the Windows partition.

Step 2 is easiest using the GUI partitioning tool in the liveCD mode of the Linux install CD. But it is also possible to do inside Windows. Step 3 is easiest inside Windows.

If you know how to use the dd command in Linux, you can back up the first 512 bytes of the drive (after shrinking the Windows partition) to a file inside that partition, using the liveCD mode of your Linux install CD, before installing Linux. That file could be used later with dd from the same liveCD mode to fix the Windows MBR when you want to remove Linux, so you wouldn't need to find the Windows program for fixing the MBR. In your situation, I would do it via dd. But most people would just wait until they need to fix the MBR and then find the program that does it. That program is normally run from a Windows install CD because by the time you discover you need it you can't boot Windows. It is easier if you run it from the installed copy of Windows before you delete the partition containing grub. Once you delete grub, you can only fix the MBR from a CD.

TobiSGD 01-13-2013 07:31 AM

Quote:

Originally Posted by EricTRA (Post 4868886)
Once you want to go back, you can delete the Linux partitions which would indicate the recovered space as free disk space.

Keep in mind that you should re-install the Windows bootloader before removing the Linux partition, otherwise the system will be unbootable.
But anyways, TroN-0074 is right, when you want to sell the machine you should reset it to manufacturer settings, usually there is a recovery partition somewhere on the disk that can be starte d with a specific key combination at boot time.


All times are GMT -5. The time now is 03:29 PM.