Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109
Rep:
"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!
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
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.
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.
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109
Original Poster
Rep:
"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.
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.
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109
Original Poster
Rep:
"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.
Distribution: Started with Kubuntu then Lucid Puppy and now XenialPup-7.5 & Mint
Posts: 109
Original Poster
Rep:
"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!"!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.