Unable to copy/transfer data to new install

Awsim

New Member
Joined
Nov 11, 2017
Messages
18
Reaction score
7
Credits
0
I have used ubuntu 16.04 with cinnamon desktop for 3 years without a problem until I updated. On updating the system crashed into fallback mode , despite every effort I was unable to restore functionality.I then stored my data on a flash drive and reinstalled ubuntu on a partition and Mint 18.2 on another partition. I now have ubuntu on one partition with my data and Mint on another partition without data.I have decided to go for Mint . I tried to copy my data from the flash drive to mint without success . I also have the same data on the ubuntu partition . Can someone kindly explain how to copy this data either from the ubuntu partition or the flash drive to my Mint partition. Thank you in advance.
 


Hi @Awsim, and welcome! Are you trying to copy while running Mint? This should be simple to copy from the flash drive. If you are trying to paste into restricted folders, you might get "permission denied" errors if you are not root or using sudo, but you should typically not be storing user data in a restricted folder. If you're getting a failure, there is usually an error given... what errors have you seen?
 
Have your tried the following:

Code:
sudo cp -rp <source directory> <destination directory>

Or if you are already root leave the sudo off.
 
Hi Robert , Thank you for your prompt reply.When writing to the Grub I did it like this: sudo cp -rp </media/jock/BACKUP DATA></dev/sda5> and I get syntax error.I'm new to this so might be doing it all wrong . Please advise regards Jock
 
In lazydogs post, <source directory> and <destination directory> are merely placeholders for the paths to the directories you are copying from/to.
You just need to substitute them for:
/path/to/source /path/to/destination

Your inclusion of the angled brackets <> are the reason you are getting a syntax error from the shell. You aren't supposed to use them. Easy mistake to make!

Try:
Code:
sudo cp -rp /media/jock/BACKUP\ DATA /dev/sda5

Note: in the above, because of the whitespace in the file-name "BACKUP DATA" I have used a backslash character to escape the space character.
If there are any spaces in any directory names or file-names, the spaces must be preceded/escaped by a backslash, otherwise the shell will not realise that the space character is part of the file/directory's name.

Hope this is of some help!
 
In lazydogs post, <source directory> and <destination directory> are merely placeholders for the paths to the directories you are copying from/to.
You just need to substitute them for:
/path/to/source /path/to/destination

Your inclusion of the angled brackets <> are the reason you are getting a syntax error from the shell. You aren't supposed to use them. Easy mistake to make!

Try:
Code:
sudo cp -rp /media/jock/BACKUP\ DATA /dev/sda5

Note: in the above, because of the whitespace in the file-name "BACKUP DATA" I have used a backslash character to escape the space character.
If there are any spaces in any directory names or file-names, the spaces must be preceded/escaped by a backslash, otherwise the shell will not realise that the space character is part of the file/directory's name.

Hope this is of some help!

I'm concerned about copying directly to /dev/sda5 though. I tried this early this morning and corrupted my filesystem really bad (shame on me!). Just now re-installing Linux, but lost a lot of data.

Lesson: Make a folder on /dev/sda5 first... then copy the data into that.
 
@Awsin: Yes, the '<>' are place holders and you do not need to include them. I would suggest staying away from directories and files with spaces.

@atanere: Was sda5 your '/'? If not you should have been able to just reformat and reinstall the files again.

As to restoring to /dev/sda5 it would really depend on how the backup was made.
I find if you are going to do a complete backup of a drive it is better to do it using 'dd' and creating an image file;
Code:
dd if=/dev/sda5 of=/media/jock/sda5.img
 
@Awsin: Yes, the '<>' are place holders and you do not need to include them. I would suggest staying away from directories and files with spaces.

@atanere: Was sda5 your '/'? If not you should have been able to just reformat and reinstall the files again.

As to restoring to /dev/sda5 it would really depend on how the backup was made.
I find if you are going to do a complete backup of a drive it is better to do it using 'dd' and creating an image file;
Code:
dd if=/dev/sda5 of=/media/jock/sda5.img

Yes, (it was my sda6)... but it was the / of my system. No biggie... I really should have known better than to do that! But I'm not sure of the OP's configuation either, so he could potentially do the same thing. :eek:
 
I'm concerned about copying directly to /dev/sda5 though. I tried this early this morning and corrupted my filesystem really bad (shame on me!). Just now re-installing Linux, but lost a lot of data.

Lesson: Make a folder on /dev/sda5 first... then copy the data into that.

@Awsin: Yes, the '<>' are place holders and you do not need to include them. I would suggest staying away from directories and files with spaces.

@atanere: Was sda5 your '/'? If not you should have been able to just reformat and reinstall the files again.

As to restoring to /dev/sda5 it would really depend on how the backup was made.
I find if you are going to do a complete backup of a drive it is better to do it using 'dd' and creating an image file;
Code:
dd if=/dev/sda5 of=/media/jock/sda5.img

Good points - I wrote the reply quickly whilst extremely tired yesterday. Writing directly to /dev/sda5/ would be a very silly thing to do! :/ Ooops!

If the OP is just copying files and folders, then they should either mount the device in their file manager, or create a directory as a mount point for the file-system on sda5 and manually mount it before copying files to the mount-point.

Or as Lazydog pointed out, if the backup was a disc image they should use dd to write directly to the device.

Sorry about that! :/
 
Good points - I wrote the reply quickly whilst extremely tired yesterday. Writing directly to /dev/sda5/ would be a very silly thing to do! :/ Ooops!

If the OP is just copying files and folders, then they should either mount the device in their file manager, or create a directory as a mount point for the file-system on sda5 and manually mount it before copying files to the mount-point.

Or as Lazydog pointed out, if the backup was a disc image they should use dd to write directly to the device.

Sorry about that! :/
I tried copying as instructed and got this message:
cp: cannot overwrite non-directory '/dev/sda5' with directory '/media/jock/BACKUP DATA' Please advise
 
I tried copying as instructed and got this message:
cp: cannot overwrite non-directory '/dev/sda5' with directory '/media/jock/BACKUP DATA' Please advise
These are my partitions:partition 5 80GB LVM2 PV (LVM2 Physical Volume (LVM2 001)/dev/sda5 and Extended Partition /dev/sda2 and Ext2 (version 1.0) — Mounted at /boot and 511 MB — 425 MB free (16.7% full)Linux (Bootable)/dev/sda1
This problem of write protected USB Thumb drives was never a problem with Ubuntu 16.04,I have 3 of them and all have the same problem with Mint 18.2.
 
Let's regroup and start over. Your File Manager should perform this task without the risk we are creating by using sudo on the command line. If Linux Mint or your File Manager is broken, then let's try to fix that so they work properly. Copying files is a basic task that needs to always work without issues.

Your previous Ubuntu developed problems, so you have installed a fresh copy of Ubuntu (that contains the files you want) and you installed a fresh copy of Linux Mint (where you want the files to go). You also have your backup files on USB... but you say the USB is "write protected" and won't copy. This is all correct?

I use Linux Mint myself, so I can follow along pretty well... but I am not familiar with LVM partitioning. If your File Manager is working properly, though, I don't think that LVM makes any difference and should not complicate this problem. Someone please correct me if I'm wrong.

So, guide me though this on your system, as it compares to my system (don't plug in your USB yet)....

1. I run Linux Mint and open the File Manager (well, Mint calls it a "File Browser"... located in the "System Tools" category, or the "All" category, or click on the panel icon next to the terminal).

2. The File Browser opens up in my home folder /home/stan. Clicking the UP arrow on the menu bar goes up one level to home (shows the stan folder, but I have no other users). Clicking the UP arrow one more time takes me to the root of my system ( / ).

3. From the root ( / ), I double-click on the media folder, where I find another stan folder. I double-click on the stan folder and go inside... it is empty. If you've jumped ahead of me, you may see your BACKUP DATA folder here already.

4. I insert a USB flash drive, and it appears. Mine has no name but just a kind of serial number.... but if the USB stick has a "label" assigned to it, that should show up (so yours may show BACKUP DATA). My folder also shows a small "X" in kind of a superscript to the USB drive's folder icon. When first inserted, the USB stick is controlled by root so this "X" indicates limited permissions.... but that is not really true.

5. Even with the "X" still showing, I can right-click on that USB folder icon, with its serial number ID, and I can choose Copy. I can then navigate with the File Browser to another location, and I can Paste that entire folder with the serial number staying intact. I pasted into my Downloads folder just to test. Also, while still in /media/stan and looking at the folder with the "X" still showing... I can double-click that folder to look inside, and then go Back (or use the UP arrow again) and it will show the folder and the "X" will now be gone.... and the permissions are now set to me, instead of root.

OK, sorry to be long and tedious.... but if your system does not perform like this, then I hope to try to understand better what is failing you. Most USB sticks do not have any kind of "write protect" available, but even if they do, it should still allow a Copy operation (that is a read operation, not a write).

If you follow the latter instruction in #5 above, and open your BACKUP DATA folder, and then UP arrow out of it... if it still shows the "X" superscript, then you probably have other permissions applied to the USB stick which you need to reduce so it will allow the copy.

Hope that helps!

Cheers
 
Let's regroup and start over. Your File Manager should perform this task without the risk we are creating by using sudo on the command line. If Linux Mint or your File Manager is broken, then let's try to fix that so they work properly. Copying files is a basic task that needs to always work without issues.

Your previous Ubuntu developed problems, so you have installed a fresh copy of Ubuntu (that contains the files you want) and you installed a fresh copy of Linux Mint (where you want the files to go). You also have your backup files on USB... but you say the USB is "write protected" and won't copy. This is all correct?

I use Linux Mint myself, so I can follow along pretty well... but I am not familiar with LVM partitioning. If your File Manager is working properly, though, I don't think that LVM makes any difference and should not complicate this problem. Someone please correct me if I'm wrong.

So, guide me though this on your system, as it compares to my system (don't plug in your USB yet)....

1. I run Linux Mint and open the File Manager (well, Mint calls it a "File Browser"... located in the "System Tools" category, or the "All" category, or click on the panel icon next to the terminal).

2. The File Browser opens up in my home folder /home/stan. Clicking the UP arrow on the menu bar goes up one level to home (shows the stan folder, but I have no other users). Clicking the UP arrow one more time takes me to the root of my system ( / ).

3. From the root ( / ), I double-click on the media folder, where I find another stan folder. I double-click on the stan folder and go inside... it is empty. If you've jumped ahead of me, you may see your BACKUP DATA folder here already.

4. I insert a USB flash drive, and it appears. Mine has no name but just a kind of serial number.... but if the USB stick has a "label" assigned to it, that should show up (so yours may show BACKUP DATA). My folder also shows a small "X" in kind of a superscript to the USB drive's folder icon. When first inserted, the USB stick is controlled by root so this "X" indicates limited permissions.... but that is not really true.

5. Even with the "X" still showing, I can right-click on that USB folder icon, with is serial number ID, and I can choose Copy. I can then navigate with the File Browser to another location, and I can Paste that entire folder with the serial number staying intact. I pasted into my Downloads folder just to test. Also, while still in /media/stan and looking at the folder with the "X" still showing... I can double-click that folder to look inside, and then go Back (or use the UP arrow again) and it will show the folder and the ""X" will now be gone.... and the permissions are now set to me, instead of root.

OK, sorry to be long and tedious.... but if your system does not perform like this, then I hope to try to understand better what is failing you. Most USB sticks do not have any kind of "write protect" available, but even if they do, it should still allow a Copy operation (that is a read operation, not a write).

If you follow the latter instruction in #5 above, and open your BACKUP DATA folder, and then UP arrow out of it... if it still shows the "X" superscript, then you probably have other permissions applied to the USB stick which you need to reduce so it will allow the copy.

Hope that helps!

Cheers
Hi Atanere, Thank you for your patience and prompt help. I have now with your assistance managed to retrieve my data.Yours is the most helpful site of the many I have looked at, thank you once again. Kind Regards Jock
 
Hi Atanere, Thank you for your patience and prompt help. I have now with your assistance managed to retrieve my data.Yours is the most helpful site of the many I have looked at, thank you once again. Kind Regards Jock

OK, Jock... very happy that you've got it going now! :cool::D
 

Members online


Top