4

My initial thought is that this is a bad idea.

But let's assume that I can't take a USB stick into my lab to run a live-Linux distro, and my computer has only 2-SATA ports. I have one 80GB SATA drive that I want to dd to my new 1TB drive.

Both drives will take my only 2 SATA ports, I have no IDE ports, I have no USB CDROM drive, and cannot use a USB stick.

Is it a bad idea to try to dd from a running OS to a new drive? Will the drive boot? I can format/partition the extra free space later, I just need to know if my new drive will boot before I begin the process.

1
  • This is what can happen when you sequentially take an image of something that can change in the process: panorama fail. Apr 9, 2020 at 3:07

4 Answers 4

2

It might boot, it might not. As you already figured, it's a bad idea. The contents of the disk might be changing as you read it.

I would rather try to set up a working system on the second drive while your system is running. Then boot into that new system and copy over the data.

1

Whether it boots or not (and it probably won't), you won't have a working system if you use dd this way.

Your best bet is probably to partition the new 1TB drive: set up a small partition and install a minimal OS on it, boot from that, then image the old drive to the larger partition of the new drive.

1

DD doesn't care so the short answer is , yes you can but as others have said it's extremely unlikely to achieve what you want to do. Some backup solutions such as acronis can take a snapshot of an online system and then recover the image to a new drive. It's likely to perform better also due to being efficient about free space.

1

If you dd correctly (A hard drive to hard drive). It should boot. I have done this before without the system booted and it has worked successfully because the MBR and everything else is preserved. Doing it with the system booted will just cause the new drive to be in the state as if you have forced shutdown the computer (as if you held the powerbutton down).

As for formatting the extra space, this is what I have done:

Assuming you have ext4 file system

mkfs.ext4 on the hard drive you want to copy to.

sudo mkfs.ext4 /dev/sdX

Then do the dd process:

sudo dd if=/dev/sdX of=/dev/sdY bs=1M

After, fsck the new drive to fix filesystem errors:

sudo fsck /dev/sdaY -f

This should work. Also, you shouldn't lose any data if this doesn't work (dont mess up the commands though), just reformat the 1TB Drive.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .