[ solved ] How to propperly save the data to a usb-stick - using rsync?

how to propperly save the data to a usb-stick - using rsync?

good day dear Friends

i want to install a notebook with a new linux -version that said: i will go from Ubuntu (which is installed at the moment ) to EndeavourOS

the first thing is - to save the data to a USB-stick

question: How can i properly copy all the data from my hard drive to USB flash drive in linux terminal?

i think that the most efficient way is to do this with the command line.
i am not so familiar with the command line - but i am willing to learn.

btw: i tried to safe the data with the dolphin.
btw: with the Dolphin i have Errors - not all will be copied - why is this so?
That’s because dolphin is working on “user permission”.

but - we require root permission. So the dolphin way - failed.

So back again to the process to do it on tt4: Well again what is aimed: i am trying to simply dismantling the whole os for the purpose of the complete reinstalling the whole os
Do you think that i need to have to work with the rsync command and besides the cp command!?

well i think we can run them with sudo to run command as root.

look here:

ubuntu@T420s:~$ ^C
ubuntu@T420s:~$ $ rsync -av /home/Dokumente/           disk /media/ubuntu/C449-8570/~ 
$:  Command not found 
ubuntu@T420s:~$ $ rsync -av /home/Dokumente/           disk /media/ubuntu/C449-8570/~
$: Command not found 
ubuntu@T420s:~$ rsync

btw - note : i have (!!) rsync on the notebook - see below:


@T420s:~$ rsync
rsync  version 3.2.7  protocol version 31
Copyright (C) 1996-2022 by Andrew Tridgell, Wayne Davison, and others.
Web site: https://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, symlinks, symtimes, hardlinks, hardlink-specials,
    hardlink-symlinks, IPv6, atimes, batchfiles, inplace, append, ACLs,
    xattrs, optional secluded-args, iconv, prealloc, stop-at, no crtimes
Optimizations:
    SIMD-roll, no asm-roll, openssl-crypto, no asm-MD5
Checksum list:
    xxh128 xxh3 xxh64 (xxhash) md5 md4 sha1 none
Compress list:
    zstd lz4 zlibx zlib none
Daemon auth list:
    sha512 sha256 sha1 md5 md4

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

rsync is a file transfer program capable of efficient remote update
via a fast differencing algorithm.

Usage: rsync [OPTION]... SRC [SRC]... DEST
  or   rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST
  or   rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST
  or   rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST
  or   rsync [OPTION]... [USER@]HOST:SRC [DEST]
  or   rsync [OPTION]... [USER@]HOST::SRC [DEST]
  or   rsync [OPTION]... rsyn

and so forth

question - why do i face these errors!?

ubuntu@T420s:~$ ^C
ubuntu@T420s:~$ $ rsync -av /home/Dokumente/           disk /media/ubuntu/C449-8570/~ 
$:  Command not found 
ubuntu@T420s:~$ $ rsync -av /home/Dokumente/           disk /media/ubuntu/C449-8570/~
$: Command not found 
ubuntu@T420s:~$ rsync

look forward to hear from you

With Dolphin you can set act as administrator. Open Dolphin , go to the hamburger menu with 3 lines, more and click view check act as administrator. Not sure if this will help?

Edit: I also am not a command line wizard and when ever i need to save files i usually do it manually using the file manager. I tend to copy files or multiple files so that the size is smaller.

1 Like

thank you i will definatly try it out.

greetings

hmm or is this not dolphin

and see here

should be possibile

at least i guess so

1 Like

This is gnome you are running…

3 Likes

You are running Ubuntu so this is wiki from ubuntuusers

https://wiki.ubuntuusers.de/rsync/

Alternatively

https://www.shellbefehle.de/befehle/rsync/

EDIT:

https://de.linux-console.net/?p=20152

https://de.linux-console.net/?p=1981

4 Likes

dear friends - hello @swh

first of all - many thanks for the reply…

seems that my distro has rsync installed it does not work propperly however in my case it wasn t so

dear @swh - do you think that i should install it now with the command:

sudo apt install rsync

ubuntu@T420s:~$ sudo apt install rsync
[sudo] Passwort fĂĽr ubuntu:
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
rsync ist schon die neueste Version (3.2.7-1).
rsync wurde als manuell installiert festgelegt.
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
grub-pc-bin libevent-2.1-7a
Verwenden Sie »sudo apt autoremove«, um sie zu entfernen.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 1 nicht aktualisiert.
ubuntu@T420s:~$

hmm - do you think that i now can continue with the rsync commands!?

for example like it is shown here. …https://askubuntu.com/questions/802672/how-to-properly-copy-files-from-hard-drive-to-usb-flash-drive-in-tty4-terminal

the folks show intersting examples - that are pretty useful for me - since i am not too familiar with the command line


You can see it automatically created /media/xieerqi/A669-34EF folder and mounted my pen drive there. Also , big advantage is that you do not need sudo.

  1. Use rsync or cp or mv to get your files to the folder reported in step 3. Consult manual pages on usage of these commands. cp and mv are simplest. mv FILE DESTINATION - in my example (where FILE is the thing you want to move to the drive)
mv FILE /media/me/4C45-110F

rsync is the best for backup however.

For example, to backup TESTDIR to my usb drive, I can do this:

$ rsync -av /home/xieerqi/TESTDIR/ /media/xieerqi/A669-34EF/~                  
sending incremental file list
created directory /media/xieerqi/A669-34EF/~
./
file1
file2
file3

sent 228 bytes  received 125 bytes  706.00 bytes/sec
total size is 0  speedup is 0.00
  1. udisksctl unmount -b /dev/sdXY. Remove the device

Example

$ udisksctl unmount -b /dev/sdc1
Unmounted /dev/sdc1.

NOTE: some drives mount to directories that have names with spaces. If you run rsync or mv with not quoted names like that, your data will not be copied to correct destination. Always quote pathnames that have spaces in them.

end of citation - well

  • conclusion: i think that i have rsync on board - and as i understand - i could run rsync-commands now… .

look forward to hear from you

see my test on my notebook (that runs now on ubuntu:
i want to save all the data and afterwards i want to install EndeavourOs - then february-release…

see the rsync-test i runned some hours ago

[quote=“otrott, post:1, topic:67910”]
well i think we can run them with sudo to run command as root.

look here:

ubuntu@T420s:~$ ^C
ubuntu@T420s:~$ $ rsync -av /home/Dokumente/           disk /media/ubuntu/C449-8570/~ 
$:  Command not found 
ubuntu@T420s:~$ $ rsync -av /home/Dokumente/           disk /media/ubuntu/C449-8570/~
$: Command not found 
ubuntu@T420s:~$ rsync

I’m not sure what your intention is to ask about problems with ubuntu in an Arch forum (eos). I’m sorry, I can’t help you with that
Maybe you should register at ubuntuusers.de.

Probably grsync gives you more options for your need

2 Likes

what is the word ´disk` doing there ?

2 Likes

hi again - thank you so much - thanks for the reply.

@joekamprad - i will try this right now… - if you look here - at the structure of my data:

your comand should work - i will test it right now - and will come back to report all what i find.

rsync -av --progress --ignore-existing /home/Dokumente /media/ubuntu/C449-8570/

would sync Dokumente under /media/ubuntu/C449-8570/Dokumente –progress will show the progress in output and –ignore-existing can be helpfully in case you copied already some part and want to restart the process without starting to copy all again…

and yes may sudo…

sudo rsync -av --progress /home/Dokumente /media/ubuntu/C449-8570/

1 Like

hi there

seems to work so

type or paste code here
[sudo] Passwort fĂĽr ubuntu: 
sending incremental file list
rsync: [sender] link_stat "/home/Dokumente" failed: No such file or directory (2)
created directory /media/ubuntu/C449-8570

sent 19 bytes  received 58 bytes  154,00 bytes/sec
total size is 0  speedup is 0,00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]
ubuntu@T420s:~$ 


will do some more tests
many many thanks for the awesome help :slightly_smiling_face:

i agree—save the headaches, get the gui: grsync

3 Likes

g day dear @drunkenvicar

first of all - many thanks for the reply. Great to hear from you

i agree—save the headaches, get the gui: grsync

nope - close but no cigar - i had to apply the paths - and use the correct path

its not like so: /home/Dokumente

but like so: /home/ubuntu/Dokumente

so this did not work :

sudo rsync -av --progress /home/Dokumente /media/ubuntu/C449-8571/

but that one:
sudo rsync -av --progress /home/ubuntu/Dokumente /media/ubuntu/C449-8571/

btw: i played with the option to get the correct path … cv:

see the part of the copied data



              0 100%    0,00kB/s    0:00:00 (xfr#51203, to-chk=5/59613)
Dokumente/new_literatur/theologie/petra_jeckel_schöpfungspoetik_/mirjamjekel_0406.jpg
              0 100%    0,00kB/s    0:00:00 (xfr#51204, to-chk=4/59613)
Dokumente/new_literatur/theologie/petra_jeckel_schöpfungspoetik_/mirjamjekel_0407.jpg
              0 100%    0,00kB/s    0:00:00 (xfr#51205, to-chk=3/59613)
Dokumente/new_literatur/theologie/petra_jeckel_schöpfungspoetik_/mirjamjekel_0408.jpg
              0 100%    0,00kB/s    0:00:00 (xfr#51206, to-chk=2/59613)
Dokumente/new_literatur/theologie/petra_jeckel_schöpfungspoetik_/mirjamjekel_0409.jpg
              0 100%    0,00kB/s    0:00:00 (xfr#51207, to-chk=1/59613)
Dokumente/new_literatur/theologie/petra_jeckel_schöpfungspoetik_/mirjamjekel_0410.jpg
              0 100%    0,00kB/s    0:00:00 (xfr#51208, to-chk=0/59613)

sent 4.694.015.209 bytes  received 1.024.752 bytes  46.256.551,34 bytes/sec
total size is 4.688.989.106  speedup is 1,00

btw: what was helpful:

How to get full path of a file?

The following usually does the trick:

echo "$(cd "$(dirname "$1")" && pwd -P)/$(basename "$1")"

or
I suppose you are using Linux.
I found a utility called realpath in coreutils 8.15.

realpath -s file.txt
/data/ail_data/transformed_binaries/coreutils/test_folder_realpath/file.txt

or Use readlink:

have a great day :slightly_smiling_face:

and many many thanks to all of you - especially to @joekamprad

1 Like

Reading through this thread - is that an AI at work?

2 Likes