I want to copy all contents from one disk to another HDD. I thought the cp command might do the trick.

cp -aR /dev/nvme0n1p1/* /dev/sda1/

/dev/nvme01np1 is the old disk that I want its content to be copied and /dev/sda1 is the new disk. However I got an error saying that /dev/nvme01np1 is not a directory.

  • Are the devices that you mentioned mounted somewhere on the system? – Kusalananda Jun 18 '18 at 11:15
  • it said that /dev/nvme01np1 is mounted on /run and /dev/sda1 is mounted on /sda1/home/ – Sabrina Zuraimi Jun 18 '18 at 11:29
  • Whoops, sorry, when I checked the "Disks" application, it said that the nvme01np1 is mounted at filesystem root whilst sda1 is mounted at /disks/local – Sabrina Zuraimi Jun 18 '18 at 11:35
  • What is your intention to do this? Are you going to replace the old HD with the new one after copy? – Winnie Tigger Jun 18 '18 at 12:02
  • Copying files from the currently running system to another disk is problematic. Better use a live usb. But if you want to make a full copy of partitions/hard drives, it's better to use dd (also from live system) which copies blocks instead of files. – pLumo Jun 18 '18 at 13:19

It depends what you’re trying to do.

Using dd is good for cloning disks. This operates at the block level, low level.

If you are making a backup, rsync is sufficient. It operates at the file system level, above block device level.

If the disks are already mounted (eg have another directory not in the /dev directory), using the rsync command is the recommended way. If you have gigabytes to transfer, rsync is handy because if the process is interrupted, it can restart at the point it was up to.

If there’s hundreds of thousands of files the file list may be too long and it errors. I’ve overcome this by batching the rsync job into subdirectories at a time.

rsync —-avz —-show-progress /path/of/source /path/of/target

Rsync can be used across a network or web securely with ssh and ssh keys and scheduled using the system cron. It’s a handy tool to know.

rsync -e “ssh -i $HOME/.ssh/id_rsa” —-avz —-show-progress /path/of/source user@host:/path/of/target

More info


Copying files from the currently running system to another disk is problematic. You should better use a live system. But with cp you cannot copy devices from /dev, you can only copy between the mount points of the devices.

If you want to clone a partition or hard drive, it's better to use dd which copies blocks instead of files.

  1. Make sure, the second hard drive has at least the same size as the first one.

  2. Startup a live system

  3. Copy hard drive, e.g.:

    dd if=/dev/nvme0n1p of=/dev/sda bs=32M

    or using cat (via):

    cat /dev/nvme0n1p >/dev/sda



The cp command would only worked if you had tried it on already mounted devices. You could run the exact by using the mounting points of those devices.

cp -aR /path/to/mount/point/of/dev/nvme0n1p1/* /path/to/mount/point/of/dev/sda1/

Usually you could find the mount points either by running mount or df -h. Of coursee dd is your friend when it comes to actually clone one device to an other (faster too). Also please note that most of the folders under the /dev are special folders, kind of devices folders, if that makes any sense.

New contributor
raism is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

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.