I have a Windows 10 machine hosting a VirtualBox running Ubuntu. In Ubuntu, I ran out of space in my /dev/sda1 partition, so in order to expand it, I (via gparted)

  • increased the size of the virtual disk
  • deleted my sda2 and sda5 partitions
  • resized the sda1
  • recreated the sda2 and sda5 partitions

Of course, now my sda5 partition is blank and I'm looking to copy over the files I have from my virtual disk backup. Using dd resulted in my partitions reverting back to their original sizes.

rsync -a --info=progress2 /dev/sdc2 /dev/sdb2 threw

Skipping non-regular file "sdc2"

I'm a complete Linux newbie so go easy on me! Where am I going wrong? What is the best way to achieve this?

  • You need to resize the filesystem after doing the copy, for example doing a resize2fs /dev/sda2 or equivalent.
    – davidgo
    Sep 8 '18 at 0:52

I realize this question is nearly two years old now, but it doesn't have an answer, so I thought I'd answer it anyway.

The files in /dev/ allow access to the raw device data. They don't provide the actual files. For that, you need to mount the filesystem. The kernel can then interpret the raw data to get the structure of files, directories, etc. that are stored on the device.

The /mnt directory is traditionally used for temporary mounts. Since you're copying from one file system to another, you'll need to create two directories to mount them.

cd /mnt
sudo mkdir sdc2
sudo mkdir sdb2
sudo mount /dev/sdc2 /mnt/sdc2
sudo mount /dev/sdb2 /mnt/sdb2

Now, if you look in the folder /mnt/sdc2, you should see your backup files. You can rsync between these two directories to copy the actual files, and umount them when you're done.

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.