LinuxQuestions.org
Review your favorite Linux distribution.
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 02-22-2021, 01:23 PM   #1
dragonballz4
LQ Newbie
 
Registered: Feb 2021
Posts: 5

Rep: Reputation: Disabled
ddrescue log file location when booting from usb?


Hello i have started to recover data from hard drive using this guide and i have used the command

ddrescue -f -n -a 5120000 /dev/sdc /dev/sdd logfile.log

my question was where will the logfile be saved if i have booted from a bootable usb stick? will it be lost on reboot?. if that is the case then what command should i use to copy it somewhere else. the pen drive is sdb
 
Old 02-22-2021, 04:03 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,137
Blog Entries: 6

Rep: Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826Reputation: 1826
In whatever directory that you run ddrescue in. If the directory is not writable, or it is a directory on a USB device that does not have persistence, then I would say you won't have a log.

Code:
info ddrescue
Make a text file out of the docs
Code:
info ddrescue > ddrescue.txt
 
Old 02-22-2021, 04:16 PM   #3
dragonballz4
LQ Newbie
 
Registered: Feb 2021
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by teckk View Post
In whatever directory that you run ddrescue in. If the directory is not writable, or it is a directory on a USB device that does not have persistence, then I would say you won't have a log.

Code:
info ddrescue
Make a text file out of the docs
Code:
info ddrescue > ddrescue.txt
i am running it from systemrescuecd live usb. in this case would there be a log?
 
Old 02-22-2021, 04:59 PM   #4
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by dragonballz4 View Post
i am running it from systemrescuecd live usb. in this case would there be a log?
A live usb is not usually writable, although it gives that impression when installing packages, running commands, etc.
The file is actually in memory so all that is needed is to save it to some place that is permanent or copy it there before you log off or reboot.

You could, instead of saving it the way you did, simply give it a path to another device (i.e. mount another usb stick, a drive not being read or written, etc. on /mnt and save the log to /mnt/ddrescue.log) then it would already be saved for you.
 
Old 02-22-2021, 05:11 PM   #5
dragonballz4
LQ Newbie
 
Registered: Feb 2021
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
A live usb is not usually writable, although it gives that impression when installing packages, running commands, etc.
The file is actually in memory so all that is needed is to save it to some place that is permanent or copy it there before you log off or reboot.

You could, instead of saving it the way you did, simply give it a path to another device (i.e. mount another usb stick, a drive not being read or written, etc. on /mnt and save the log to /mnt/ddrescue.log) then it would already be saved for you.
ah ok so what command should i use for copying it to permanent place. sorry i am a bit unfamiliar with linux.
 
Old 02-22-2021, 05:25 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
So the short answer is to stick a USB in, see where it automounts to (been a while since I booted systemrescue) and simply copy the file after ddrescue finishes. Next session make sure the USB is inserted first and use the saved logfile on ddrescue command.
Code:
cp logfile.log /media/theusb/
 
Old 02-22-2021, 05:52 PM   #7
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quote:
Originally Posted by dragonballz4 View Post
ah ok so what command should i use for copying it to permanent place. sorry i am a bit unfamiliar with linux.
If you are smart enough to use ddrescue then surely you can mount a device and copy a file there, or change the log part of the ddrescue command to write the log there.

ddrescue is quite complex and possibly dangerous for someone who cannot even mount a device or copy a file.

read the man pages. mount, cp, rsync, umount, etc.
 
Old 02-22-2021, 06:39 PM   #8
dragonballz4
LQ Newbie
 
Registered: Feb 2021
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
So the short answer is to stick a USB in, see where it automounts to (been a while since I booted systemrescue) and simply copy the file after ddrescue finishes. Next session make sure the USB is inserted first and use the saved logfile on ddrescue command.
Code:
cp logfile.log /media/theusb/


i could also copy the file to the internal drive of the computer(the two drives that are involved in the transfer process are externals). the internal drive is sda so i assume cp logfile.log /dev/sda1/ works?
 
Old 02-22-2021, 07:45 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Yeah -
I read the link you posted and had /dev/sda in my head as the broken disk - didn't read your post properly. Typically you wouldn't put it in the root, but somewhere like /dev/sda1/home/${USER}/
Shouldn't really matter in this case, the file will probably be owned by root anyway.
 
Old 02-23-2021, 12:37 PM   #10
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
So in your case the ddrescue command could be modified to
Code:
ddrescue -f -n -a 5120000 /dev/sdc /dev/sdd /root/logfile.log
This is assuming you are running ddrescue from the operating OS on your system.
If instead you are running from a live USB then there would be an additional step for mounting the main partition of /dev/sda which I would assume is /dev/sda2 and it would be something like this
Code:
mount /dev/sda2 /mnt
ddrescue -f -n -a 5120000 /dev/sdc /dev/sdd /mnt/root/logfile.log
In either case the logfile.log would be located in /root on the main OS filesystem. The path could be whatever you choose to where you want it saved.

Since you have already started with the log as logfile.log then once ddrescue completes it would be simple to use the mount command above then copy the file to the HDD with "cp -a logfile.log /mnt/root/logfile.log" and the file will be saved. Do that before you reboot.

Last edited by computersavvy; 02-23-2021 at 12:41 PM.
 
Old 02-23-2021, 12:51 PM   #11
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
BTW, SystemRescue has the backing-store feature.
 
Old 02-23-2021, 04:35 PM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Given this is 2 external disks, why use systemrescue at all ?. Install ddrescue on the system and save all the angst.
 
  


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
ddrescue log file location when booting from usb? dragonballz4 Linux - Software 2 03-20-2021 04:56 PM
ddrescue mapfile and logfile location? sdowney717 Linux - Software 5 02-13-2016 02:25 PM
LXer: Google I/O Android News: Location, Location, Location (Plus Cloud Messaging and Bluetooth) LXer Syndicated Linux News 0 06-05-2013 01:00 PM
In Apache server, How to change log file location and log format for access log fil? since1993 Linux - Server 1 08-19-2009 04:14 PM
location, location, location! mermxx LQ Suggestions & Feedback 9 09-25-2004 03:08 AM

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

All times are GMT -5. The time now is 03:52 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