LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-07-2018, 06:03 PM   #1
AoiHana
LQ Newbie
 
Registered: Feb 2016
Posts: 26

Rep: Reputation: Disabled
Unhappy how to make a virtual partition filesystem, combining SEVERAL disks into a huge one ?


Hello.

My problem is this one:
I need to generate a disk image of a whole 2 To disk in order to pick some important files I mistakingly purged. I'll do it with Testdisk, fro cgsecurity. But I don't have other 2 To disks, instead, several 1 To disks.
How can I emulate a big partition with putting in a way, those smaller disks in a row ? It must be that someone had to that someday.

Thanks for your help, here a desperate history student...
 
Old 12-07-2018, 06:09 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
You use LVM. The approximate workflow:
Code:
pvcreate /dev/sdx    # format all your 1TB disks as physical volumes
pvcreate /dev/sdy
pvcreate /dev/sdz

vgcreate myvolgroup /dev/sd[xyz]    # put them in a new volume group

lvcreate -L 2048G -n mybigdisk myvolgroup  # create a big logical volume
After that, you have a 2TB device /dev/myvolgroup/mybigdisk, on which you can make a filesystem, which you can then mount.

Before you follow my instructions, please find an LVM tutorial on the internet to confirm you are doing the right thing.
 
Old 12-07-2018, 06:36 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by AoiHana View Post
I need to generate a disk image of a whole 2 To disk in order to pick some important files I mistakingly purged.
No you don't. Classic case of xyproblem. Just tell us what the problem is and ask for suggestions.

Testdisk doesn't interfere with the source drive. Simply use the smaller drives as targets for testdisk. Works best if you can limit what you are looking for - only word files say, or photos. Generates a lot less, and easier to search. Be aware you get random names for the files.
 
Old 12-07-2018, 06:38 PM   #4
AoiHana
LQ Newbie
 
Registered: Feb 2016
Posts: 26

Original Poster
Rep: Reputation: Disabled
I can do this on empty disks without risks, at least.
Thanks, exactly what I needed, and pretty simple at that ! I love you.

Didn't see last post:
Quote:
No you don't. Classic case of xyproblem. Just tell us what the problem is and ask for suggestions.
Ok. I purged two to three odt files in a partition which now 1.7 To, and was the /home partition of the last installation, before I wiped it out and reinstall (I wrecked it for other reasons). These files are important works.
Using photorec would take several days non stop of work to scan the whole disk, I can't do this, and in the past weeks, everytime I tried, it shut itself out after between 10 minutes and a hour of work. I mean it blocked completely, doesn't respond to the close button. So that I can't resume the process later.
It makes the computer awfuly slow, so I want it to work only the night. I guess with testdisk, not having to look into what the copied octets mean (while making the image) would avoid that slugginess, but I can be wrong.

It's strange, the first (tens of ?) times I ran photorec, it could scan up to a third of the partition maybe, in less than 8 hours. Eventhough the partition IS read-only, it looks like the repeated scans altered it, so that photorec became unusable, crashing again and again.
And it's not like only the screen was blocked, no, AAAALL ressources are stolen and the scan is NOT being made.

I complained about this on cgsecurity's forum, and they told me (answered only ONCE, if memory serves me well) to use testdisk instead, way faster. So...

I'll go for LVM, until someone's has a better idea :,(

Last edited by AoiHana; 12-08-2018 at 07:06 PM.
 
Old 12-08-2018, 07:51 PM   #5
AoiHana
LQ Newbie
 
Registered: Feb 2016
Posts: 26

Original Poster
Rep: Reputation: Disabled
I used LVM. Now, I have no clue on how to use testdisk to recover lost file of a otherwise usable partition.
 
Old 12-08-2018, 10:39 PM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You really should not need lvm. Try 'foremost'. Read the part about the config file at the end of the man page.
 
Old 12-08-2018, 11:28 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Quote:
Ok. I purged two to three odt files in a partition which now 1.7 To, and was the /home partition of the last installation, before I wiped it out and reinstall (I wrecked it for other reasons).
Quote:
a partition which now 1.7 To, and was the /home partition of the last installation
At face value what is now 1.7 TB was or is not the same as the last installation?

I assume the idea was to use the dd command to create an image file of your existing drive to the new LVM. You can run the data recovery tools using the image file as the source instead of the original drive. If you reinstalled exactly as the original installation and the location of the deleted files were such that they were located on the disk were they were not overwritten then there is still a chance they could be recovered. However, at the moment it does not look promising.
 
Old 12-09-2018, 06:20 AM   #8
AoiHana
LQ Newbie
 
Registered: Feb 2016
Posts: 26

Original Poster
Rep: Reputation: Disabled
No more than one day was spent when I understood I did something wrong, and I stopped using that partition instantly. Less than a day after that, I put in read-only mode. It's still on the same disk, on the same computer. Nothing changed whatsoever. That disk is huge, and I did NOT write Mo-big after the removal of the files. Many files do have been saved, I saw that, but I am still looking for the ones I want. There can't be more favorable situation to get them back, contrary to what you say.
I actually can't fathom why or how the partition would have been altered, since it was always scanned while read-only.
It worked the whole night doing the image, and hasn't finished. No progress bar with dd, shit.

Thanks Awasomemachine, I didn't something like foremost, I guess it's faster than the two previous tool ?
But in the manual, it DOES need an image to work on. So still need LVM.
 
Old 12-09-2018, 06:42 AM   #9
AoiHana
LQ Newbie
 
Registered: Feb 2016
Posts: 26

Original Poster
Rep: Reputation: Disabled
Unfortunately, it couldn't finish:
Quote:
root@debian /h/mehdi# dd if=/dev/sda5 of=lvm_disk/image.dd
dd: erreur de lecture '/dev/sda5': Erreur d'entrée/sortie
2202237224+0*enregistrements lus
2202237224+0*enregistrements écrits
1127545458688 bytes (1,1 TB, 1,0 TiB) copied, 37452,6 s, 30,1 MB/s
I'm still trying foremost with this. Are there better dd (or better than dd ?) parameters to avoid errrors on loooong session ? Or if it's in the disk itself, ignore it and resume writing octets.

Last edited by AoiHana; 12-09-2018 at 06:43 AM.
 
Old 12-09-2018, 08:33 AM   #10
AoiHana
LQ Newbie
 
Registered: Feb 2016
Posts: 26

Original Poster
Rep: Reputation: Disabled
I gave foremost the parameters:
foremost -i image.dd -t zip,pdf -q (quick mode, seems unrecommenced only for NTFS) -Q (quiet mode) -d (indirect detection) -K 4000 -o where_to_save

Often foremost sets an urgence flag, which was seems to be errors, but I don't get it.
Code:
foundat=mimetypeapplication/vnd.oasis.opendocument.textPK
foundat=meta.xml<?xml version="1.0" encoding="UTF-8"?>
<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:ooo="http://openoffice.org/2004/office"
It continues on a few lines after that. Those are corrupted files, right ?

I would appreciate being able to see how much it has progressed, like with sending SIGUSR1 to dd. It seems quite slow... any option ?

Last edited by AoiHana; 12-09-2018 at 09:23 AM.
 
Old 12-09-2018, 08:47 AM   #11
AoiHana
LQ Newbie
 
Registered: Feb 2016
Posts: 26

Original Poster
Rep: Reputation: Disabled
/home/me/foremost.conf has (only):
odt n 10000000 opendocument.text
I made several tests on usb stick partitions, all files it seems to recover (are called odt, but I doubt those are the good ones) are unreadable.
Even for existing, normal files, not even deleted ones.
I guess the signature is wrong then !

Last edited by AoiHana; 12-09-2018 at 09:22 AM.
 
Old 12-09-2018, 10:22 AM   #12
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by AoiHana View Post
Unfortunately, it couldn't finish:
I'm still trying foremost with this. Are there better dd (or better than dd ?) parameters to avoid errrors on loooong session ? Or if it's in the disk itself, ignore it and resume writing octets.
ddrescue is designed to work with damaged disks. You will probably find a package available in your Linux distribution.
 
Old 12-10-2018, 10:44 AM   #13
AoiHana
LQ Newbie
 
Registered: Feb 2016
Posts: 26

Original Poster
Rep: Reputation: Disabled
I used it. It worked, up to a point, the very last one: in fact the very last octet/bit, can't be rescued. I would have expect at two third, but no. I wonder what that is.

I managed for the signature:
odt n 1000000000 \120\113\003\004\024\000\000\010\000\000???\115\136\306
It seems to do the job, and tell appart odt (or at least opendocument formats) from zip. I guess there are more requirement than for photorec, since foremost won't ask the file system for the file boundaries.

It's strange, all files recovered range from 450 to 600 Mo. Why ?? I can't give a footer, since not all odt have a common pattern. Most files are corrupt to the point of crashing libreoffice, so it will take time...

Last edited by AoiHana; 12-11-2018 at 09:23 AM.
 
  


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
With Linux 4.15.4 or later several systemd services fail, like flush and partition services, for several distros fusion809 Linux - Laptop and Netbook 6 04-13-2018 11:23 PM
How to zip several files to several zip with one command? thomas2004ch Linux - Newbie 4 02-08-2010 08:13 AM
Combining files into one cobra7x Linux - General 10 05-05-2005 01:39 AM
Combining multiple NICs to one virtual NIC damista Linux - Networking 2 04-26-2005 10:00 PM
Combining 2/more ADSL/Internet connection into ONE gateway carboncopy Linux - Networking 1 01-29-2005 07:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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