I used 2 commands cpio
and tar
to perform the same operation of backing up data to an external drive which is my 8Gb pen drive (sandisk brand). At the time of executing the commands, it outputs something implying that it has backed up something but when I check the media, it is blank.
ravi@ravi-Aspire-5315:~/Documents/testing$ find . -type f -newer .last_time
./jill1
ravi@ravi-Aspire-5315:~/Documents/testing$ find . -type f -newer .last_time | cpio -o > /dev/sdb2
1 block
ravi@ravi-Aspire-5315:~/Documents/testing$
Now please look at the backed up media.
ravi@ravi-Aspire-5315:/media/ravi$ df -h | grep sdb2
/dev/sdb2 3.9G 8.0M 3.7G 1% /media/ravi
ravi@ravi-Aspire-5315:/media/ravi$ ll
total 24
drwxr-xr-x 3 ravi ravi 4096 Jan 12 11:10 ./
drwxr-xr-x 3 root root 4096 Nov 20 13:51 ../
drwx------ 2 root root 16384 Jan 12 11:10 lost+found/
I tried many times by backing up all files also but noting is shown in the above directory /media/ravi
which is mount point of /dev/sdb2
I tried the tar
command but the same issue.
ravi@ravi-Aspire-5315:~/Documents/testing$ tar -cvf /dev/sdb2 `find . -type f -newer .last_time`
./jill1
Then I found that my media /dev/sdb2
got corrupted!
Then to check the media via nautilus
, I clicked on the media file.
Here it is mentioning that the mount point is /media/ravi/poon
but df -h
mentions a different mount point /media/ravi
ravi@ravi-Aspire-5315:~/Documents/testing$ df -h | grep sdb
/dev/sdb2 3.0T 3.0T 3.9G 100% /media/ravi
The size is also wrongly shown now as 3.0T though it is 3.9 GB as shown in the command output in the beginning of this thread.
The above is what I found in my pendrive.
Before using this media, I 1st tried in an SD card of 32 GB. There also the issue was coming. So, I felt that the issue is with the SD card as I suspected the ingenuity of that card. But after using my branded 8GB pendrive (sandisk brand) bought from amazon.in, I am confirmed that the problem is something else.
find . -type f -newer .last_time
" – Ravi Jan 12 '16 at 12:47