Move home from one drive to another

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
borgward
Level 5
Level 5
Posts: 633
Joined: Mon Dec 17, 2012 10:18 pm

Move home from one drive to another

Post by borgward » Mon Nov 19, 2018 11:23 am

What is the procedure for copying home on an external drive to another drive? I know I can use the cp -R command to do it. Are there any preliminary actions I need to do before running the command? I tried:

sudo cp -R /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom /home/tom/
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/91DB9FC65C8A671CB624CB6093DA22C6FA7C2BAF': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/5EA2DF23DE0AE8A37A723B9AB88B1A03E056E06C': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/7382E52C4EB229723C4F58CE2B114877204C1080': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/04423455D7160C15B133D891C20BBE4F7667AC10': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/15C557C90FF1099CB7C001C228153A0F73566D9A': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/E06ECC8BC40308CCFBEA128AF20FFA329F6FC1D7': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/BDD409CA7276B5374C80F4EF47864231D642C384': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/E5A9B8C368ED0377888E6B020EB9E84641BEEE42': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/2E216ED2E1DDA0AC7758D9A1135429C86C4EF929': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/732E56DF6AC0C500D4EF659F47615328E23B5A00': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/F4965364C59569BF723A999BAA3FFF6CF3064965': No such file or directory
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/B2294B66D9AC02C8CCA87A7EF0064444814495EB': No such file or directory

Maybe I needed to prep either drive before running cp. I do not understand why cp -R is trying to read non existent files. It was suggested that maybe the external drive was in use. I disabled the Alarm Clock applet but still get the same result from cp -R. I can copy individual files and folders from home on the external drive to home on my laptop using cp -R. The laptop has Mint 19 V2 Cinnamon installed. External drive has Mint18.0 Cinnamon on it.

User avatar
WharfRat
Level 20
Level 20
Posts: 11873
Joined: Thu Apr 07, 2011 8:15 pm

Re: Move home from one drive to another

Post by WharfRat » Mon Nov 19, 2018 11:50 am

What results do you get from sudo rsync -naviuh --progress --delete-after /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/ /home/tom/

It's a dry run so nothing will actually happen.
ImageImage

User avatar
Flemur
Level 16
Level 16
Posts: 6291
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Move home from one drive to another

Post by Flemur » Mon Nov 19, 2018 12:28 pm

borgward wrote:
Mon Nov 19, 2018 11:23 am
What is the procedure for copying home on an external drive to another drive? I know I can use the cp -R command to do it. Are there any preliminary actions I need to do before running the command? I tried:

sudo cp -R /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom /home/tom/
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/91DB9FC65C8A671CB624CB6093DA22C6FA7C2BAF': No such file or directory
...
Maybe I needed to prep either drive before running cp. I do not understand why cp -R is trying to read non existent files.
1 - You don't need to copy/restore the firefox cache. It would hurt nothing to delete it all.
2 - To see info that might help, try

Code: Select all

ls -al /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/
3 - (I think) The only time I've seen those types of errors, the disk was dying.

And

Code: Select all

sudo cp -R /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom /home/tom/
should be

Code: Select all

sudo cp -R /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom /home/.
or you'll end up with /home/tom/tom
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

borgward
Level 5
Level 5
Posts: 633
Joined: Mon Dec 17, 2012 10:18 pm

Re: Move home from one drive to another

Post by borgward » Mon Nov 19, 2018 4:13 pm

Flemur wrote:
Mon Nov 19, 2018 12:28 pm
borgward wrote:
Mon Nov 19, 2018 11:23 am
What is the procedure for copying home on an external drive to another drive? I know I can use the cp -R command to do it. Are there any preliminary actions I need to do before running the command? I tried:

sudo cp -R /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom /home/tom/
cp: cannot stat '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/91DB9FC65C8A671CB624CB6093DA22C6FA7C2BAF': No such file or directory
...
Maybe I needed to prep either drive before running cp. I do not understand why cp -R is trying to read non existent files.
1 - You don't need to copy/restore the firefox cache. It would hurt nothing to delete it all.
2 - To see info that might help, try

Code: Select all

ls -al /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/
ls -al /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/7382E52C4EB229723C4F58CE2B114877204C1080': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/15C557C90FF1099CB7C001C228153A0F73566D9A': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/04423455D7160C15B133D891C20BBE4F7667AC10': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/E06ECC8BC40308CCFBEA128AF20FFA329F6FC1D7': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/F4965364C59569BF723A999BAA3FFF6CF3064965': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/BDD409CA7276B5374C80F4EF47864231D642C384': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/B2294B66D9AC02C8CCA87A7EF0064444814495EB': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/5EA2DF23DE0AE8A37A723B9AB88B1A03E056E06C': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/E5A9B8C368ED0377888E6B020EB9E84641BEEE42': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/2E216ED2E1DDA0AC7758D9A1135429C86C4EF929': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/91DB9FC65C8A671CB624CB6093DA22C6FA7C2BAF': No such file or directory
ls: cannot access '/media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom/.cache/mozilla/firefox/mwad0hks.default/cache2/entries/732E56DF6AC0C500D4EF659F47615328E23B5A00': No such file or directory
total 123788
drwx------ 2 tom tom 2023424 Feb 8 2017 .
drwx------ 4 tom tom 4096 Feb 8 2017 ..
-rw------- 1 tom tom 4157 Feb 7 2017 000F5777D99C5E01E70803FB6D41879D57C66D22
-rw------- 1 tom tom 12382 Feb 6 2017 007F734DAD2A596FC278CDFC9EB2535D6BB517D4
-rw------- 1 tom tom 4626 Feb 7 2017 00801F32E6DBBDB4D8BE5C015CFF42F505E38105
-rw------- 1 tom tom 11142 Feb 6 2017 008124A2C1198E5E75D64FA19E4AD8D4645F3E09
-rw------- 1 tom tom 4383 Feb 6 2017 00929974F9E285E98730C6407EBBD352538626E5
-rw------- 1 tom tom 352031 Feb 6 2017 00972FDCE8BC0B93110B79F0CD52972ECE686856
-rw------- 1 tom tom 221249 Feb 6 2017 00A5C1620242CB94C88B93FFCDB4B57E450D4427
-rw------- 1 tom tom 16240 Feb 6 2017 00A796A64FFFBA008135B9A3D2D078BDF832F527
-rw------- 1 tom tom 2320 Feb 7 2017 00A9FBCC4E669AB89D0A7757E3C34F8E002CE533
-rw------- 1 tom tom 37002 Feb 7 2017 00C73938A27AD50D75F6EA4F551751D6D59C426A
-rw------- 1 tom tom 3799 Feb 7 2017 00CE9B90DA9CC51A93DC70ADDAEB25FC53B154EB
-rw------- 1 tom tom 4461 Feb 6 2017 025172747C4AFEEAF50670A358D38C761F5A62D7
-rw------- 1 tom tom 113664 Feb 6 2017 02591D9256CE248B797F83D373F4FE5785CDB32C
-rw------- 1 tom tom 16240 Feb 6 2017 026B785D6A3B8BF8CF35AE8B8203E68CC92F9A9C
-rw------- 1 tom tom 16240 Feb 6 2017 029AA358251FC00883F7010BDF3AC19EE441EC63
-rw------- 1 tom tom 4627 Feb 6 2017 02CEC0DD4D24064506F93D943B3BB12351AE9C2C
-rw------- 1 tom tom 10779 Feb 6 2017 02D152C2316AED4A4A68A084ABA0F1655C4C95F6
-rw------- 1 tom tom 5229 Feb 6 2017 02E6426D2A582CD227D13F59F1C9A5285EA730DD
-rw------- 1 tom tom 14984 Feb 6 2017 02EF48E75771DBBA0BC46DCE36E79776BB6CC26D
-rw------- 1 tom tom 4367 Feb 6 2017 02F0A34EDECC047EF39D1826DEA7C8ED544F84C9
-rw------- 1 tom tom 6863 Feb 6 2017 0322DA942700970C2A253FC834D007CBFCDD6757
-rw------- 1 tom tom 14984 Feb 6 2017 03347855E1E6BCEC79AE3D6B4DD739D12559BC34
-rw------- 1 tom tom 14984 Feb 6 2017 036DAF8F8E81E6D0DFC621B1958EC3A5905CC808
-rw------- 1 tom tom 4352 Feb 6 2017 03A8AABBEA70D084E3DCA0E7D4C075D2936A7C97
-rw------- 1 tom tom 13332 Feb 7 2017 03B0A68BE89DB720E3B5727DBA4519E51CB289EC
-rw------- 1 tom tom 9501 Feb 7 2017 03D4D23853A2D896DAE43133A6D076F28DA6CCF3
-rw------- 1 tom tom 3893 Feb 7 2017 03FDF16AD1D2FC2047DDEAEFDDA0FFF3A9161190
-????????? ? ? ? ? ? 04423455D7160C15B133D891C20BBE4F7667AC10
-rw------- 1 tom tom 431719 Feb 6 2017 046F69166C6FEFCA2255DA37C7FFF37371FDB0BA
-rw------- 1 tom tom 42593 Feb 6 2017 04798D00960FA51D5576DB0A9E093786F469844C
-rw------- 1 tom tom 4385 Feb 6 2017 0490702279017881B8A10D979A941C9B20AEE2C8
-rw------- 1 tom tom 5741 Feb 6 2017 04AB88C598197CE2B1F2C0A1D66F7ECE560BC899
-rw------- 1 tom tom 4382 Feb 6 2017 04C9D52A1D7D86E52280C8B2E76B0E5F5BC1179F
...
A461DE7CBAE34332CFFEC7CD7C8B7AB839F3BBB1
-rw-------rw------- 1 tom tom 338937 Feb 6 2017 FF6E9E1B1396E392499780B7580C77AA3B86F454
-rw------- 1 tom tom 14984 Feb 6 2017 FF71C6B9B25A6C07EF430246B3DF6C5B72E022D2
-rw------- 1 tom tom 9399 Feb 7 2017 FF7869B9C8C99FC8FC9FBA9FD3A6226FDBF26E68
-rw------- 1 tom tom 6051 Feb 7 2017 FF7C80A4A7616FA44DFAC913B1426193869A4C3A
-rw------- 1 tom tom 12096 Feb 7 2017 FF87C4984353623C7715ED3855D74B88349E8E5C
-rw------- 1 tom tom 4943 Feb 6 2017 FF8CE17917B61D32C84DE620E5277146667D2739
-rw------- 1 tom tom 3528 Feb 7 2017 FFA6B04817F16A7A6BFC1FD01BC9CC5EB9FCCC8F
-rw------- 1 tom tom 16240 Feb 6 2017 FFC16A294789B4DE981DEA358EA075F74DD2F1A3
-rw------- 1 tom tom 6647 Feb 7 2017 FFC31767A57E41CFD95495D7C148E7FBF7396651
tom@tom-Inspiron-1520:~$ ~

What's the significance of the line above with the question marks?

Flemur wrote:
Mon Nov 19, 2018 12:28 pm
3 - (I think) The only time I've seen those types of errors, the disk was dying.
You mean the non existent files? Funny thing is that over 2 years ago I got message that that drive had a fatal error. I went out and bought another drive to install on and backup my stuff to. I was curious as to when the drive would fail. I have been using it ever since.

Flemur wrote:
Mon Nov 19, 2018 12:28 pm
And

Code: Select all

sudo cp -R /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom /home/tom/
should be

Code: Select all

sudo cp -R /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom /home/.
or you'll end up with /home/tom/tom
Yes master I see the error of my ways. That is so obvious.

User avatar
Flemur
Level 16
Level 16
Posts: 6291
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Move home from one drive to another

Post by Flemur » Mon Nov 19, 2018 6:15 pm

borgward wrote:
Mon Nov 19, 2018 4:13 pm
Flemur wrote:
Mon Nov 19, 2018 12:28 pm
And

Code: Select all

sudo cp -R /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom /home/tom/
should be

Code: Select all

sudo cp -R /media/tom/9983149b-3a05-462b-96a6-939625e6c7b6/tom /home/.
or you'll end up with /home/tom/tom
Yes master I see the error of my ways. That is so obvious.
It wasn't obvious to me**, so I made a test case - the "/" at the end makes it act differently:

Code: Select all

$ cd temp
$ mkdir a
$ mkdir a/b
$ touch a/b/file
$ du -a
  0 ./a/b/file
  4 ./a/b
  8 ./a
$ mkdir c

# this copies the content of 'b' (=file) to 'c';
# like with a regular non-directory file.

$ cp -r a/b c
$ du -a
  0 ./c/file  # COMPARE TO BELOW
  4 ./c
  0 ./a/b/file
  4 ./a/b
  8 ./a
$ rm -r c
$ mkdir c

# add "/" to c and it copies the directory b to c:
# like cp -r a/b c/.

$ cp -r a/b c/
$ du -a
  0 ./c/b/file  # COMPARE TO ABOVE
  4 ./c/b
  8 ./c
  0 ./a/b/file
  4 ./a/b
  8 ./a
$
** Because I always use the "cp from /to/whatever/." format, with the trailing "." (dot), to make it clear that it gets copied into the directory - 'whatever/from', and doesn't replace the directory; whatever = from.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

borgward
Level 5
Level 5
Posts: 633
Joined: Mon Dec 17, 2012 10:18 pm

Re: Move home from one drive to another

Post by borgward » Mon Nov 19, 2018 7:03 pm

How do I know when the copy command has completed? The $ prompt has not yet returned in the terminal I ran it in and the HDD indicator light is still flashing. About 200GB will be transferred. Hours, days to complete?

I now have a $ prompt. The HDD light on my laptop is still churning. What's with that?

Post Reply

Return to “Software & Applications”