0

I'm upgrading my windows desktop hardware and doing a clean OS install. I'm using SystemRescueCD to prepare my old drives for the upgrade. Long story short, a bit of an emergency, I coudln't do this in windows before I upgraded the hardware (failed motherboard) and windows doesn't boot with the new hardware. I'm familiar with unix/linux but not so much when it comes to doing things with windows and have some questions.

I have 3 drives. 2 old drives that were the system (c:, /dev/sda) and data (d: /dev/sdc) drives before I upgrade the hardware. I have one new drive (/dev/sdb) which I think I might have used briefly in a USB dock because it's formatted as FAT16.

I'm currently waiting for /dev/sdb to finish formatting. I used mkntfs /dev/sdb1 to make it an NTFS partition. Is that going to be good enough?

I want to copy the contents of /dev/sda1 and /dev/sdc1 into directores on /dev/sdb1 as backups (already have files backed up to other device but faster if on same system). What's the best way to do the copy so that I can easily see the files in windows and not have to worry about hidden files or special permissions? It's also about 0.4TB of data so something that will work fast would be nice. I don't want to move the partition, just copy the contents of those 2 partitions to directories in the new drives partition.

Do I need to do anything about assigning drive letters? When I install windows I plan on formatting my c: drive (/dev/sda) as my new system drive/partition.

I want the new drive (/dev/sdb) to have a d: drive letter in windows but don't want to reformat it since it will contain the data from my old system drive.

My old d: drive (/dev/sdc) I don't want to reformat yet but would like it to be my e: drive.

2 Answers 2

2

To copy all the contents of /dev/sda1 to a backup folder on /dev/sdb1:

mkdir /dev/sdb1/backup
cp -avr /dev/sda1/* /dev/sdb1/backup

The will recursively (-r) copy everything on sda1, attempt to preserve ownership/permissions in 'archive' mode (-a) and give you some verbose (-v) output so that you don't sit looking at a prompt doing nothing for an extended period wondering if it's still working.

Repeat for the stuff on /dev/sdc1

I'll let somebody else do the drive letter assignment - I'm not much of a Windows user.

2
  • thanks. Does the -a option also preserve the time stamps and other meta data? Jan 24, 2014 at 4:22
  • Yes, it will try and preserve timestamps and a couple of other things, however since you are writing to an NTFS partition I don't know how much of the archive function will succeed.
    – djg
    Jan 24, 2014 at 4:57
0

First, I think you know the difference, but just to be sure /dev/sda (the drive) and /dev/sda1 (the partition) are not one and the same, not even if there is only one partition on the drive (sda). C: will be /dev/sda1 not /dev/sda).

The formatting should be good enought but what you also need to do is mount the partitions first before you can copy anything:

sudo mkdir /mnt/sda1 /mnt/sdb1 /mnt/sdc1
sudo mount -o ro /dev/sda1 /mnt/sda1
sudo mount -o ro /dev/sdc1 /mnt/sdc1
sudo mount /dev/sdb1 /mnt/sdb1

( the old drives are mounted read-only).

Now you can copy the files using cp

cd /mnt/sda1
cp -avr . /mnt/sdb1/backup_c
cd /mnt/sdc1
cp -avr . /mnt/sdb1/backup_d

or use find and cpio (which AFAIK does the same):

cd /mnt/sda1
find . -print0 | cpio -pdmv0 /mnt/sdb1/backup_c
cd /mnt/sdc1
find . -print0 | cpio -pdmv0 /mnt/sdb1/backup_d

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.