LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-03-2019, 03:10 AM   #1
khunphet
Member
 
Registered: Jul 2007
Location: Chiang Rai, THAILAND
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109

Rep: Reputation: 0
"RSYNC" option and use


Hello fellow Linux Users,

My Windows OS is not well! It’s been that way for almost a whole month! It somehow got damaged while on loan to a friend who isn’t overly IT savvy, but was kind enough to watch my apartment while I had to attend a conference in Bangkok. Upon my return, my first inkling that things were not right was that I could not access the Internet; the icons on my desktop were all askew and in different positions than when I left for the conference; trying to move the icons back to their proper locations was impossible; I was unable to copy and paste anything – icons, files either to or from thumb drives; MS Word and MS Excel refused to register files when I opened them up; simply searching for files with the MS Search utility wasn’t doing its job.

All of which pretty much made the laptop most user-unfriendly!

However, if I booted up with Xenialpup-7.5 from a thumb drive, Linux was able to see, access and open files as normal. The bypassing of the Windows OS when booting up has allowed me to work with the laptop for a while. However, it seems that the real and long-term solution to my problem is to do a clean installation of the Windows OS.

Before doing that, I know that I have to copy out many files and folders that contain important info to me, but with the damaged OS everything is at a standstill. I am hoping that Linux and its “rsync” utility can rescue me so that I can save the files and folders I need before undertaking a clean installation that will wipe everything off Drive C:

My Drive C: presently contains the following 22 folders and miscellaneous files:
Documents and Settings
Drivers
FFOutput
HP_41C battery case
Internet
I5281204.043
MediaServer
Peter
ProgramData
Program Files
$RECYCLE.BIN
RECYCLER
RegBackup
Search-Locate
Swsetup
SWTOOLS
System Volume Information
Users
Win32-loader
WINDOWS
$WIN_NT$.~BT
$WIN_NT$.~LS
(and miscellaneous files)

My goal is to copy all of Drive C: (folders, sub-folders and misc. files) over to an external World Elements 2TB drive. How? By using Xenialpup’s “rsync” utility (with some options to help the transfer process along).

Attachment #1, i.e. “capture9904.png”, shows what Linux can see and access on my laptop. I am working on one, single laptop with its damaged OS on Drive C:, an OK Drive D: and an attached external HDD. I have Xenialpup-7.5 on a thumb drive which has already saved me quite a bit of effort. I am not on or connected to any type of network.

When I boot my laptop via the Xenialpup thumb drive, open a terminal window as an administrator and type in “rsync”, Linux responds with the following information which can be seen in attachment #2, i.e. “Rsync Command.txt”.

I’ve gone over the three and a half pages of what I see in the terminal window and am frankly at a loss if I can create the right command line for achieving my goal. I would like to do a dry run to see if “rsync” will do what I want it to do via this command:
root# rsync –nEv /mnt/sda1 /mnt/sdc1/BAK_C
Note: I have already created an empty folder called “BAK_C” on the external drive.

As I am a rather inexperienced, 76 year-old-Linux newbie, I’m coming to the User Forum to get some feedback, improvements on the above command line or suggestions for a better command line syntax that will copy the complete sda1 partition with all its folders and sub-folders plus the miscellaneous files noted above over to the external drive. I firmly believe that one is never too old to learn..... specially with & thanks to experienced teachers!

I look forward to reading you soon,

Khun Phet / Peter
in Thailand
Attached Thumbnails
Click image for larger version

Name:	capture9904.png
Views:	16
Size:	18.5 KB
ID:	31007  
Attached Files
File Type: txt Rsync Command.txt (9.7 KB, 20 views)
 
Old 08-03-2019, 05:43 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
As you have thrown in -E as something you want, I would use:
Code:
rsync -naEv /mnt/sda1 /mnt/sdc1/BAK_C
The small 'a' gives you most of the good options used as a standard

You might want to look into -z, for compression, if it is a large drive

Last suggestion which I use in a work place is to perform the task inside the 'screen' command in case you should lose connection for some reason via the command line
 
1 members found this post helpful.
Old 08-03-2019, 06:27 PM   #3
khunphet
Member
 
Registered: Jul 2007
Location: Chiang Rai, THAILAND
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109

Original Poster
Rep: Reputation: 0
"RSYNC" option and use

Attn: Grail

Thanks for your reply and suggestions. It seems I was and am on the right track.

I would, however, appreciate it if you would please amplify your remark 'to perform the task inside the 'screen' command.

Khun Phet / Peter
in Thailand
 
Old 08-04-2019, 05:56 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
There is a command called 'screen', some distros have it installed by default, otherwise you will need to use your package manager to have it installed.

Once installed, if you google for ~ linux screen command ~ you should get back plenty of hits on how to use it

Here is an intro description from the man page:
Code:
DESCRIPTION
       Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells).  Each virtual terminal provides the functions of a DEC VT100 terminal and, in addition, sev‐
       eral control functions from the ISO 6429 (ECMA 48, ANSI X3.64) and ISO 2022 standards (e.g. insert/delete line and support for multiple character sets).  There is a scrollback history buffer for each  virtual  terminal  and  a
       copy-and-paste mechanism that allows moving text regions between windows.
Hope that helps
 
Old 08-04-2019, 06:07 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,127

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I understand the motivation grail, but the whole point of using rsync is it doesn't matter. It is eminently restartable (better stated as resumable maybe).
"screen" is good, but (maybe) unnecessary and potentially (in this case) only adds to confusion for the OP.
 
Old 08-04-2019, 06:09 AM   #6
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by grail View Post
As you have thrown in -E as something you want, I would use:
Code:
rsync -naEv /mnt/sda1 /mnt/sdc1/BAK_C
The small 'a' gives you most of the good options used as a standard
Including -p, which preserves ALL permissions, so that the -E option isn't needed anymore.
 
Old 08-04-2019, 11:17 PM   #7
khunphet
Member
 
Registered: Jul 2007
Location: Chiang Rai, THAILAND
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109

Original Poster
Rep: Reputation: 0
"RSYNC" option and use

Hello, good people,

Based on the suggestions that have been provided, I shall proceed without the 'screen' manager as it seems a truly extra step in the process and then change my rsync originally proposed command to:

rsync -napv /mnt/sda1 /mnt/sdc1/BAK_C

and see what the dry run does. Option '-n' is described as "performs a trial run with no changes made". But since "no changes" will be made, how will I know what has happened?

I await a bit of clarification before actually typing the command into a terminal window.

Many thanks for your assistance so far...

Khun Phet / Peter
in Thailand
 
Old 08-05-2019, 01:34 AM   #8
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

rysnc will output to your terminal what files it would have copied and some other information if you run it with the -n and -v flags. Eg:

Code:
mkdir -p foo/{00..02}/{a..f}
% rsync -avn foo bar 
sending incremental file list
created directory bar
foo/
foo/00/
foo/00/a/
foo/00/b/
foo/00/c/
foo/00/d/
foo/00/e/
foo/00/f/
foo/01/
foo/01/a/
foo/01/b/
foo/01/c/
foo/01/d/
foo/01/e/
foo/01/f/
foo/02/
foo/02/a/
foo/02/b/
foo/02/c/
foo/02/d/
foo/02/e/
foo/02/f/

sent 517 bytes  received 130 bytes  1,294.00 bytes/sec
total size is 0  speedup is 0.00 (DRY RUN)
% rsync -av foo bar 
sending incremental file list
created directory bar
foo/
foo/00/
foo/00/a/
foo/00/b/
foo/00/c/
foo/00/d/
foo/00/e/
foo/00/f/
foo/01/
foo/01/a/
foo/01/b/
foo/01/c/
foo/01/d/
foo/01/e/
foo/01/f/
foo/02/
foo/02/a/
foo/02/b/
foo/02/c/
foo/02/d/
foo/02/e/
foo/02/f/

sent 517 bytes  received 130 bytes  1,294.00 bytes/sec
total size is 0  speedup is 0.00
Also, -p is not needed since that is provided by -a. I think that the only other option that you may want to consider is -u if the process is interrupted and you need to start it again. When I use rsync I typically use "-auv" - in fact my fingers tend to type those options automatically.

Code:
rsync -auvn /mnt/sda1 /mnt/sdc1/BAK_C
Evo2.
 
1 members found this post helpful.
Old 08-05-2019, 02:36 AM   #9
khunphet
Member
 
Registered: Jul 2007
Location: Chiang Rai, THAILAND
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109

Original Poster
Rep: Reputation: 0
"RSYNC" option and use

Attn: evo2

Many thanks for the explanation which I found quite interesting due the sample you provided. I will also change my command to " rsync -nauv /mnt/sda1 /mnt/sdc1/BAK_C " and give rsync a whirl.

This should be most interesting and I look forward to doing it all over again without the
'-n' option making it a real run, not only a trial run.

evo2, I appreciate your prompt reply and advice.

Khun Phet / Peter
in Thailand
 
Old 08-06-2019, 07:02 AM   #10
khunphet
Member
 
Registered: Jul 2007
Location: Chiang Rai, THAILAND
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109

Original Poster
Rep: Reputation: 0
Thumbs up "RSYNC" option and use

Attention to all my good helpers!

On Aug 5th evening I gave "rsync -auv /mnt/sda1 /mnt/sdc1/BAK_C1" a whirl and for 1 hour and thirty-one minutes, rsync toiled at copying all of my Drive C: over to the external Drive:F. At the end, I was advised that rsync had sent 47,492,269,083 bytes and that 2,403,067 bytes were received at 8,957,033.88 bytes/sec for a total size of 47,471,827,714 bytes. Total movement: 122,835 files and 10,936 folders.

On Aug 6th morning I did "rsync -auv /mnt/sda1 /mnt/sdc1/BAK_C2" to see what would happen. In 1 hour and thirty-one minutes, rsync had sent 47,492,391,518 bytes and that 2,403,228 bytes were received at 8,609,588.46 bytes/sec for a total size of 47,471,949,949 bytes. Total movement: 122,838 files and 10,936 folders.

It was amazing to watch the speed at which data was being shifted from one place to another, but proof that it all works. I'm a bit puzzled that the numbers didn't come out exactly the same, but I've got my fingers crossed that a reasonable copy has taken place.

Consequently, I need to take this opportunity to thank everybody who took some time to guide me along in this learning experience. I think it appropriate to mark this case "Solved!"!

Thanks for helping!

Regards,
Khun Phet / Peter
in Thailand
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] rsync: How to use -prune-empty-dirs with the options: "+ */", "+ *.c" AND "- *"? andrew.comly Linux - Server 2 12-14-2015 06:19 AM
unpredictable "delete" "move to trash" or "cut" file menu option dorianrenato Linux - General 3 11-28-2011 06:41 PM
rsync "skipping non-regular files" with --archive option andrewtblake Linux - Server 2 04-29-2010 04:15 PM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
Help With Java Problem Please"""""""""""" suemcholan Linux - Newbie 1 04-02-2008 06:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration