copy directory tar.gz file from root to external hard disk error
6,465
Do not try to write to a device file (/dev/sdxY
) - you should write to the mount point (/media/username/drive_name
)
Since your trying to copy as root you should be doing:
cp -av dspace_tar.gz /media/username/external_hdd_name
If you don't know the mount point of the device, first plug it in then do this to get the address:
lsblk -f
The options:
-f
option provided more information about the filesystems.-a
: used when copying archives-v
: displays the process in the terminal
Related videos on Youtube
Author by
user1387755
Updated on September 18, 2022Comments
-
user1387755 almost 2 years
I am able to login to root terminal and then create tar zip file by running the command
tar -zcvf dspace_tar.gz /home/dspace
in a root terminal.But I am not able to copy using the command
cp -av dspace_tar.gz /dev/sdb1
which is my external hard disk.
I get two errors:
stat error
andno such file or root directory.
-
George Udosen over 7 yearsPlease you should be doing
cp -av dspace_tar.gz /media/username/external_hdd_name
-
George Udosen over 7 yearsDo
sudo lsblk -f
to see the address of the device when its plugged in. -
Zanna over 7 years@George I suggest writing an answer here
-
George Udosen over 7 years@Zanna done that.
-
-
George Udosen over 7 yearsOnly when he is trying to format the HDD should he be doing
mkfs -t ext4 /dev/sdb1
doing that will destroy any data he has there -
anna328p over 7 yearsBad idea. He has filed in the gas.