Author Topic: Repartition Hard Drive with Dual OS and Not Losing Data  (Read 11526 times)

0 Members and 1 Guest are viewing this topic.

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 1785
  • Country: us
Repartition Hard Drive with Dual OS and Not Losing Data
« on: January 02, 2023, 12:08:46 am »
I have an old laptop with dual operating systems, XP and Ubuntu. Due to updates, Ubuntu is near the end of its partition size.

I'd like to increase the partition size, but don't want to risk losing either OS.

A few places online explained how to perform this, but I'm uncertain whether they were accurate. Does anyone know an easy way to resize the partition for Ubuntu without damaging either OS?
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11858
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #1 on: January 02, 2023, 12:20:45 am »
To increase a partition size, there needs to be some empty space to increase into. If the disk is already fully occupied, then you will need to decrease another partition to make room. And to do that you may need to defragment it first, in order to move all the empty space to the end before you shrink it.

To do these operations it is best to use a trusted and reliable tool. I have used the tools built into Windows 7 or 10 for this, but I have no experience of XP. There are of course third party tools available--"Partition Magic" comes to mind, but it is not the only one.

If you have any fear of data loss, then it would be a good idea to make an image backup first, and make sure you have backed up all your important data as well.

That said, I have done this kind of operation from time to time and it has gone smoothly.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 1785
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #2 on: January 02, 2023, 12:28:39 am »
Quote
To increase a partition size, there needs to be some empty space to increase into.

Yes, correct. I didn't mention that part of it, but I plan to shrink the XP section a bit. I mainly use this laptop for random stuff, so I can afford to lost size on XP.
 

Offline BradC

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #3 on: January 02, 2023, 04:22:08 am »
Grab a copy of systemrescuecd and fire up gparted. It can resize and move as required, although moving a partition is a *slow* process.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 1785
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #4 on: January 02, 2023, 04:27:59 am »
Is systemrescuecd part of Gparted or are they to be used together?
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11858
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #5 on: January 02, 2023, 04:52:40 am »
Is systemrescuecd part of Gparted or are they to be used together?

I believe systemrescuecd is a CD that boots into a system rescue version of Linux, and from there you can run Gparted and rearrange your disk partitions while none of the installed operating systems are running.
 

Offline BradC

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #6 on: January 02, 2023, 06:02:25 am »
I believe systemrescuecd is a CD that boots into a system rescue version of Linux, and from there you can run Gparted and rearrange your disk partitions while none of the installed operating systems are running.

Precisely. Traditionally a CD image, but easy enough to pop onto a USB using the instructions on the site. So useful I keep multiple copies around, a partition on my larger USB connected drives and PXE boot from the server at home.

Boot into systemrescuecd. Start X (startx) then run gparted from the x-terminal (gparted).

A combination of systemrescuecd and a working net connection (for searches) is like a get out of jail free card for IT.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3341
  • Country: nl
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #7 on: January 07, 2023, 04:40:11 pm »
I'd like to increase the partition size, but don't want to risk losing either OS.

If the "not losing your OS (or data)" is dear to you, then start with at least making a backup. Or simpler:

Buy a bigger SSD (if that works) or HDD (if your old laptop does not support SSD's)

The prices of such hardware is so low that it is silly to consider another option.
My data is worth much more than all my PC hardware together. My data is irreplaceable, while PC hardware is easily replaceable commodity stuff.

Here in the Netherlands there are lots of shops who sell second hand PC hardware from office equipment for low prices.
You can get a new 1TB 2.5" HDD for EUR50, or a second hand 500GB for EUR20.

Old PC's tend to have 120GB or smaller. If you buy a bigger disk, you can clone the old one to the new one, and then keep on using the old one as a backup. That way you have both more room and a decent backup for a modest price.

Also, I would not think twice about loosing the Ubutu OS. Re-installing fresh is 5 minutes of work and may 15 minutes of coffee drinking if your pc is slow. You can use dpkg to create a list of installed packages (and then re-install them) but in my experience it's better to simply make a list of programs you like, and then only re install those. It takes more time, but it sheds off a lot of accumulated crud.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 1785
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #8 on: January 09, 2023, 04:34:05 am »
Quote
The prices of such hardware is so low that it is silly to consider another option.
My data is worth much more than all my PC hardware together. My data is irreplaceable, while PC hardware is easily replaceable commodity stuff.

I fully agree with you.

This laptop is really junk since it has XP, but I have a hard time parting with computers, especially laptops. I've found that sometimes I need an older unit to handle a particular piece of software or hardware, or I like a throw around laptop, etc...

In any case, I think my plan wasn't to use Ubuntu as much as I have, so I didn't partition it too big thus focusing the space on XP. Now it's had several updates, I've used it to create hard drive images (which I think I've saved to the XP partition - but don't remember), etc... so I've got messages about low disk space.

On a side note, I should also buy new backup drives because I have three external ones (on a network switch) that are mirror images of each other. I only connect/power them when I want to backup my main computer, but the drives are old.

They are 1TB and over a decade old, but again, not always powered.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 1785
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #9 on: January 15, 2023, 02:43:49 pm »
I started this yesterday and got a warning that I may lose my boot sector (?).

All I did was shrink the XP partition and expand the Ubuntu partition by making more room at the beginning.

Is that error normal, or, if I had proceeded, would have lost data?
 

Offline rdl

  • Super Contributor
  • ***
  • Posts: 3666
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #10 on: January 15, 2023, 05:54:59 pm »
How big is the laptop's disk? Whatever it is, maybe just replacing it with a newer and bigger one would be the best thing to do.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 1785
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #11 on: January 16, 2023, 03:18:24 am »
Quote
How big is the laptop's disk? Whatever it is, maybe just replacing it with a newer and bigger one would be the best thing to do.

It's an old system running XP. Ubuntu serves me well sometimes, but I've noticed different old laptops continue to serve different purposes.

Anyway, you bring up a good point as I was considering just installing a bigger hard drive (currently has 120GB). If I do that, what happens to both partitions? One is approximately 15GB and the other is approximately 90GB (it doesn't add to 120, so I may be wrong to exact sizes, and know 120 could be slightly smaller), but it also has a few other partitions (maybe stuff from Dell).
 

Offline rdl

  • Super Contributor
  • ***
  • Posts: 3666
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #12 on: January 16, 2023, 11:44:29 am »
I did exactly this on an old Windows 7 32 bit machine last year, but I don't remember all the details of how I did it and it was a desktop not a laptop. I do know all I used was the built in back up and diskpart utilities. Does your laptop have room for a second drive?
 

Online magic

  • Super Contributor
  • ***
  • Posts: 6756
  • Country: pl
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #13 on: January 16, 2023, 12:23:02 pm »
What's the current order of partitions? Post something like fdisk -l

It generally is possible to shrink FAT32/NTFS partitions, move partitions around and enlarge most Linux filesystems.
However, if something goes wrong during the process (unexpected I/O errors, power loss, system crash) you may end up in a weird state that would be extremely difficult to recover from.

That being said, I have done such things a few times :phew:
Doing it on a second HDD avoids the risk of data loss. Simply clone everything, including OEM service partitions, then manipulate as desired.
« Last Edit: January 16, 2023, 12:24:35 pm by magic »
 

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 2565
  • Country: gb
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #14 on: January 16, 2023, 12:33:18 pm »
If theres room to add a second drive you could leave the partitions alone and just move your ubuntu home file to the new drive.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 1785
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #15 on: January 16, 2023, 02:04:35 pm »
I'll post an fdisk later. No room for a second hard drive.

So should I ignore the error I mentioned above (I may lost boot data or something like that if I change the partitions)?

 

Offline themadhippy

  • Super Contributor
  • ***
  • Posts: 2565
  • Country: gb
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #16 on: January 16, 2023, 02:16:12 pm »
Quote
So should I ignore the error I mentioned above (I may lost boot data or something like that if I change the partitions)?
If your 101% certain your back ups are good then there's nothing to loose.
 

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 1785
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #17 on: January 17, 2023, 03:25:54 am »
Well, I was more curious whether the error is valid or if a typical warning as a precaution.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11858
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #18 on: January 17, 2023, 03:33:08 am »
Well, I was more curious whether the error is valid or if a typical warning as a precaution.

Never ignore warnings. They are there for a reason. If you proceed and make the disk unbootable, would you have a recovery plan?
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11858
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #19 on: January 17, 2023, 03:34:23 am »
I'll post an fdisk later. No room for a second hard drive.

So should I ignore the error I mentioned above (I may lost boot data or something like that if I change the partitions)?

The standard protocol that I have always used is to clone the old disk onto a new, bigger disk, swap the disks, and keep the old disk as a backup.
 
The following users thanked this post: SeanB

Offline bostonmanTopic starter

  • Super Contributor
  • ***
  • Posts: 1785
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #20 on: January 17, 2023, 03:38:06 am »
Quote
The standard protocol that I have always used is to clone the old disk onto a new, bigger disk, swap the disks, and keep the old disk as a backup.

I am aiming that way as the drive is only 120GB. I'm not sure what I'll use this XP/Ubuntu 32-bit laptop for that will need bigger, but I just looked, and a WD Blue SSD is $35 for a 250GB.

I don't believe my previous question got answered. If I clone the drive 120GB > 250GB (easy to do because I have a cloning device), what happens to each partition? Will I still need to adjust them or will both grow by X ?
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11858
  • Country: us
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #21 on: January 17, 2023, 04:21:23 am »
Quote
The standard protocol that I have always used is to clone the old disk onto a new, bigger disk, swap the disks, and keep the old disk as a backup.

I am aiming that way as the drive is only 120GB. I'm not sure what I'll use this XP/Ubuntu 32-bit laptop for that will need bigger, but I just looked, and a WD Blue SSD is $35 for a 250GB.

I don't believe my previous question got answered. If I clone the drive 120GB > 250GB (easy to do because I have a cloning device), what happens to each partition? Will I still need to adjust them or will both grow by X ?

If you buy a new disk it usually comes with free cloning software. Read the instructions for that software. As I recall from the last time I did this, it allowed me to choose the destination partitions before starting the copy. It goes something like this:

1. Select old disk
2. Select new disk
3. Choose layout of new disk
4. "Go"
 

Online magic

  • Super Contributor
  • ***
  • Posts: 6756
  • Country: pl
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #22 on: January 17, 2023, 09:12:23 am »
I don't believe my previous question got answered. If I clone the drive 120GB > 250GB (easy to do because I have a cloning device), what happens to each partition? Will I still need to adjust them or will both grow by X ?
Nothing happens; partitions are preserved exactly as they stood on the source disk. There will be unallocated space at the end.

If the partition you want to enlarge is the final one then it's a very easy job. If not, you will need to move stuff around.
 

Offline BradC

  • Super Contributor
  • ***
  • Posts: 2106
  • Country: au
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #23 on: January 17, 2023, 09:41:56 am »
I clone using dd, then you just put the partitions where you want them and expand them out to use the remaining space. Saves double handling and at the end of the day you are still going to have to correct the NT Bootloader.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14440
  • Country: fr
Re: Repartition Hard Drive with Dual OS and Not Losing Data
« Reply #24 on: January 17, 2023, 08:16:33 pm »
Clonezilla works fine.
I've also used commercial apps for this.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf