1

Say I have an imaginary 200 GB hard drive (not SSD) with two 100 GB partitions on it (A being the fist, B being the second). Partition A is empty. Partition B is half full. I want to delete partition A and resize partition B all the way to the beginning of the drive so that B has 200 GB.

My question is following - is it possible to resize B without having to move B's contents to the beginning of the drive? Can the resize operation proceed quickly? I have already resized partition "towards end of the drive" (like deleting B and resizing A to whole drive in this case) and it was always very fast. But in my case, I fear all data need to be moved or at lest their location updated in MBR since the start location of the partition will change.

I want to use some freely available Windows/Linux software for the job.

EDIT: The drive is used for data only, there is no system installed the partitions.

  • Filesystems generally have their information at the start of the partition. If you just extend the partition to the left your filesystem sectors are floating in the middle of the partition. Your kernel probably won't be able to make sense of it without a custom filesystem driver. – jiggunjer Feb 18 '17 at 14:02
  • If it's an SSD, moving 100GB of data will take no time at all. – Darren Feb 19 '17 at 8:41
2

I am in no way an expert for NTFS, but I'd like to give some general guidelines.

1) I have seen a lot of things regarding PC software, but never heard of an application which could extend NTFS partitions to the beginning of a drive without moving the data.

2) Whether such application does exist or not: You absolutely should not do such sorts of things without taking a full backup of the disk before.

Extending, shrinking or moving partitions is always a high-risk operation, so it is strongly recommended to take a backup of the whole disk before doing such things, and you should keep the time the operation takes as short as possible.

So, even if there was such an application which could do what you asked about, it still would have to (recursively) adjust a great bunch of pointers, and that would take its time, and therefore I would not use it.

In your case, I would do the following:

Minimum (bad) solution

a) Delete partition A

b) Re-create partition A with a size which leaves enough room for partition B (after that step, there will be some room between partition A and partition B)

c) Copy all data from partition B to partition A (this could fail if partition A is too small now; in this case, that solution actually isn't one)

c) Delete partition B

d) Re-create partition B with bigger size (after that step, there will be no room between partition A and partition B)

e) Copy all data from partition A to partition B

Better solution

a) Take a full backup at least of partition B

b) Delete both partitions

c) Re-create both partitions with sizes as needed

d) Restore the backup of old partition B to new partition B

Good solution

a) Buy a new disk

b) Partition the new disk, thereby creating partitions with sizes as needed

c) Take a full backup of partition B of the old disk

d) Restore that backup into partition B of the new disk

e) Keep the old disk in a safe place in case something went wrong. After having worked with the new disk for a month or so, when knowing that everything is well, you could use the old disk for other things.

So why is the first solution bad?

First, as you may know, NTFS is quite complex. There are things like ACLs, hard links, symbolic links, shortcuts, sparse files and alternate streams, to name a few of them. Heck, even the integrated Windows Explorer shows wrong directory sizes if there are hard links! Personally, I am knowing exactly two programs which reliably copy data without losing such information; both are command line, and their usage is fairly difficult to understand. I definitely would only recommend them for advanced users.

Second, if your partition B is where your OS resides, just copying its data (even with one of the tools I mentioned) to partition A won't make the OS boot from partition A.

But even that bad solution will cut the time the high-risk operations (i.e. resizing the partition) will take to a reasonable amount.

Some additional notes:

  • These are my personal opinions and best-practices I have developed over the years (I have done such things more than one time)

  • When saying "full backup", I of course mean image-type backups (as opposed to file-based backups)

  • There are great free and commercial tools for taking image-based backups. For example, look for dd, CloneZilla or TrueImage.

  • When restoring full backups, depending on the software you use, the destination partition might need to have at least the size the original partition had.

  • After having restored a full backup to a partition, if that partition is greater in size than the partition the backup came from, you eventually (as a second step) have to extend the file system to make it use the whole partition (yes, having a file system which is limited to 100 GB on a partition which is 200 GB in size is indeed possible); whether this is necessary or not depends on the backup software used.

  • And finally, once again, think about it: You could run backups overnight, so what is the problem with the time that takes compared to losing valuable personal data (e.g. the photos which you have taken when you have been on Mount Everest's peak)? And if you don't have the money for a new disk, then you could ask a friend if he will let you use his external disk for a day or two ...

|improve this answer|||||
  • Thanks for your answer. There is no system (Windows etc.) installed on either of the partitions. – Kozuch Feb 18 '17 at 14:11
  • I had a few typos in my answer, and in my first solution have ignored that you probably want to keep both partitions. I have updated my answer. – Binarus Feb 19 '17 at 8:20
1

Using gparted on a live OS:

  • Delete A

  • Make B as small as possible to save time.

  • Copy and paste B into the free space starting at the first sector. This will preserve the partition UUID in case the bootloader uses it. Watch out you don't overwrite your bootloader, maybe leave some MB free space at the start.
  • Delete B and extend the new B to cover the rest of the drive.
  • Depending on how your bootloader is installed you may need to update it. A default GRUB install should still work without updating.
|improve this answer|||||
  • The drive is used for data only, there is no system installed the partitions. – Kozuch Feb 18 '17 at 14:19
  • Then you don't need to worry about the bootloader. Still need to move the filesystem to the left though. Gparted copy and paste works pretty fast. You can also use a normal Linux OS instead of live. Just unmount the target first. – jiggunjer Feb 18 '17 at 14:24
0

Native Method

Windows 7 and newer can resize NTFS partitions in place, but can't move the start of the partition. To resize in place, you want Start -> Windows Administrative Tools -> Computer Management -> Disk Management.

From here you can right click partitions to expand or shrink. This can even resize your system partition.

If you want to move the partition using Window's built in tools, you'll need to manually shuffle files around. For a non-system partition, the way I'd do it is:

  1. Delete A (the empty partition at the start of the disk) and create a new partition as "New B"
  2. Move as much data from B to "New B" as you can. Use Shift+click to select in Windows explorer and then right click to get properties and wait till it shows a size. This will tell you how much you have selected so you can see if it will all fit.
  3. If "New B" fills up before B is empty, then use the above tool to shrink B as much as possible.
  4. Make a new temporary partition "temp1" at the end of the disk in the space B filled up. No start copying from B to "temp1"
  5. Repeat 3,4 with "temp2", "temp3", etc until B is empty
  6. Delete B; it's empty
  7. Expand "New B"
  8. Start copying files from the temp partition that's nearest the front of the disk. When it's empty, delete it and expand "New B"
  9. Repeat step 8 until it's done

Free as in Beer

There's tons of "free trial" and "free for home use" software that can resize and even move partitions. These tools usually require rebooting to affect the system partition, but they can move and resize NTFS and FAT partitions used by Windows. If you need to shrink or grow the system partition as one of your steps, use the native tool.

I've used MiniTool and EaseUS recently and both work well. MiniTool tries to trick you into installing Spyware (watch our for "I agree to the terms and want to install the spyware"; uncheck and click next) but is free for both personal and business use. EaseUS is only free for home users and is expensive for businesses with multiple computers. Both nag you with promos to sell you a license.

For your specific use case (a purely data partition) these tools can do it all in 2 steps: 1. delete the A partition 2. resize B to the beginning of the disk

Free as in Speech

Already mentioned above is GParted Live. But you can install GParted on most any linux distro. Most live USB distros allo. I have had trouble with operations on Windows System partitions resulting in a non-bootable Windows installation, however. To tools above won't break your boot.

Gparted works great for any linux partitions or for Windows data partitions.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.