Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ddrescue & btrfs [done]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Sun Nov 07, 2010 3:14 pm    Post subject: Reply with quote

avendesora

roger that. By rights I should could be satisfied with the distfiles being copied. You are suggesting to not attempt a kernel at all? I was going to stop.

This is an exercise so I'm quite happy to stop at this point and wrap up.
The kernels can be re-emerged other than most appear to have been retired from the portage tree.

I don't quite follow the
Quote:

Hints: I think you'll need a two step approach. Find rebuild the directory structure in the target (possibly using 'find . -type d'), then 'copy' the files (possibly using 'find . -type f'). You could also try the more adventurous avenue of a recursive version of the previous script, which could build the target hierarchy as it goes.

Also don't use any kernel (compiled) image from that dead btrfs unless you have a way of knowing it's not damaged (like a hash of it stored somewhere other than on that failed partition). Probably won't boot at all if it's damaged, but you never know.


If you strongly recommend I stop right here, then I am happy to heed your good advice.

From the distfiles exercise, I'm working on the impression that if files don't copy, then it will just pull up and I can abort.
That said, I am treading new ground.
At face value, a kernel is more demanding given it is large and in the form it was in it had been compiled, so it will contain many binary files.
If it's too sticky / dangerous, I shall just forget it and finally delete my 48.2 gig gen2.img.
_________________
idella4@aus
Back to top
View user's profile Send private message
avendesora
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1739
Location: Betelgeuse vicinity

PostPosted: Sun Nov 07, 2010 3:33 pm    Post subject: Reply with quote

Here's my opinion:

Trying to recover the distfiles is safe: portage keeps (multiple) hashes for each of those files. So if something you recovered was in fact corrupt, emerge will tell you and you can download that again.

Trying to recover anything else is risky, but could very well be worth it for valuable data - not the case here as you have stated.

Trying to recover something like kernel sources, or a compiled image, is not worth the risk involved - you have no way of determining if it is corrupt or not.


But if you want to continue this exercise in data recovery, please go ahead - I'm just warning you against using what you have recovered (except for the distfiles), and that forcibly creating I/O-crashed processes is not advisable. Follow NeddySeagoon's advice for dd, and try to come up with the tree walker yourself - the more you scratch your brain to make it work, the more you'll take out of the exercise.

Next step in the exercise would be to retry doing all that, but directly manipulating the raw image (to get rid of the I/O failures and yung dd's and all). Probably hard to real hard - best place to start looking at that would be the btrfsck source code, I think, to understand the filesystem layout. Would be easier if it was an "old" filesystem (ext2, fat or something like that). Modern filesystems tend to have more intricate on-disk structures.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Sun Nov 07, 2010 3:50 pm    Post subject: Reply with quote

avendesora

Quote:

try to come up with the tree walker yourself


I have no idea what this means. I am not familiar with using find. If you re-read the post, Neddy and I pretty well determined the path of repairing the btrfs is way way way too deep. Reading btrfs source code I have already done a little out of curiosity. It's is way way way too deep.

The only issue from my point of view is the kernels are not in the portage tree. My thought is

go the /mnt/ftp/kernel-2.6.30-r8. Copy as much as I can and maybe it will be in a state to recompile in its new /mnt/gentoo.
To reduce the risks, select only the source code content on bypass any compiled binary files.
Need a script to copy the directory structure of the kernel short of re-making those dozens of dirs one by one.
Modify the script to select and copy only non-binary files - source code and those required kernel files which are basically text files.
If it doesn't work, the exercise was tried and failure is not really a problem because it is not valuable data.
I am not proceeding in any way without a response and to wrap it up and say thanks much for the help is a sensible likely outcome to reach
_________________
idella4@aus


Last edited by idella4 on Sun Nov 07, 2010 4:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54334
Location: 56N 3W

PostPosted: Sun Nov 07, 2010 4:00 pm    Post subject: Reply with quote

idella4,

Copied no error, probably means different things to you and me.
No error means it was able to read the every block the damaged btrfs metadata pointed it to. That does not mean that was the right list of blocks comprising the file, nor does it mean that even if it was the right list of blocks that your data is intact inside them.

As avendesora says, if you use those files without veryfying the contents, you get to keep all the pieces.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Sun Nov 07, 2010 4:05 pm    Post subject: Reply with quote

Neddy,
sure. How do I verify a file? I take it you're suggesting to do so before trying to emerge a copied file. A stat? Peruse the two files via hexedit?
The btrfsck once used listed 3 lines of mis-aligned metadata.
That's way open for interpretation. Each flaw has an impact of what scale? How can you tell?
3 is a very low number?? I can only guess. Either way, this exercise is on the verge of being wrapped up.
_________________
idella4@aus
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54334
Location: 56N 3W

PostPosted: Sun Nov 07, 2010 4:12 pm    Post subject: Reply with quote

idella4,

You need something like a md5sum for each file, or you need another known good file copy to do a diff against.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Sun Nov 07, 2010 4:21 pm    Post subject: Reply with quote

Neddy,

sure. ok. Modify my bash script to md5sum each source and destination file and run diff source destination and output it to a logfile.txt?
Are you going to tell me now the source files in gen2.img lack a standing of a known good file?
If so, I don't know if verifying them is achievable without re-fetching every one from portage.
Here is my final added extra.

Code:

idella@genny /mnt/fedora/store $ ls -l /mnt/ftp/store.img
-rw-r--r-- 1 root root 4294968320 Aug 25 00:25 /mnt/ftp/store.img

idella@genny /mnt/fedora/store $ sudo dd if=/mnt/ftp/store.img of=/mnt/gentoo/store.img
^Z
[1]+  Stopped                 sudo dd if=/mnt/ftp/store.img of=/mnt/gentoo/store.img
idella@genny /mnt/fedora/store $ ls -l /mnt/ftp/store.img
-rw-r--r-- 1 root root 4294968320 Aug 25 00:25 /mnt/ftp/store.img


The rest are kernels & xen-3.4-testing.hg

Code:

idella@genny /mnt/fedora/store $ ls /mnt/gentoo/distfiles/linux*
/mnt/gentoo/distfiles/linux-2.6.18.tar.bz2  /mnt/gentoo/distfiles/linux-2.6.30.tar.bz2
/mnt/gentoo/distfiles/linux-2.6.21.tar.bz2  /mnt/gentoo/distfiles/linux-2.6.31.tar.bz2
/mnt/gentoo/distfiles/linux-2.6.23.tar.bz2  /mnt/gentoo/distfiles/linux-2.6.32.tar.bz2
/mnt/gentoo/distfiles/linux-2.6.25.tar.bz2  /mnt/gentoo/distfiles/linux-2.6.34.tar.bz2
/mnt/gentoo/distfiles/linux-2.6.26.tar.bz2  /mnt/gentoo/distfiles/linux-2.6.35.tar.bz2


As it is I have no xen kernels in the distfiles.
_________________
idella4@aus
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54334
Location: 56N 3W

PostPosted: Sun Nov 07, 2010 4:41 pm    Post subject: Reply with quote

idella4,

You are missing the point. dd read something from somewhere in your filesystem but you don't know it was it the right something.
You need known good md5sums or known good files.

Comparing before and after the copy tells you nothing.

Think of the problem in vfat, where a corrupt FAT shows that one disk block belongs to several files. How do you tell which file it belongs to, if any?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Sun Nov 07, 2010 4:58 pm    Post subject: Reply with quote

ok. well, that implies I would need to re-fetch them from portage.
A few samples would be worth the effort, but not the 5,950 files.
Let's put it this way. If I were to re-emerge say the 2.6.30 kernel pretending for the moment that it were present in portage, without verifying it, I should take an image of my genny prior to emerging and attempting to compile it. If it breaks genny into pieces, to avoid the humiliation of picking up those pieces, I have genny backed up and can re-implant genny in the usual way. That is the "wrong way" to test a package file.

That said, the retrieval exercise is done. Those distfiles are in place to satisfy the exercise and any emerging I may find myself doing will likely be new packages and not draw upon those 3-4 gig.
To wrap up, testing a selected sample may suffice as a token test of a selected sample, and the remainder can remain an unknown powder keg that I can surpass with a system image backup in place intermittently updated.

The only real cost of my exercise was losing suse and the replaced state of /mnt/gentoo in a folder in suse's root.
_________________
idella4@aus
Back to top
View user's profile Send private message
avendesora
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1739
Location: Betelgeuse vicinity

PostPosted: Sun Nov 07, 2010 5:30 pm    Post subject: Reply with quote

I said the distfile part is safe because portage keeps hashes of known-good files, and those hashes are assumed to be sufficient.
If your recovery recovered corrupted distfiles, emerge will tell you just that and you'll have to re-download (only) the broken distfile(s).
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54334
Location: 56N 3W

PostPosted: Sun Nov 07, 2010 5:54 pm    Post subject: Reply with quote

avendesora,

Thats true for things still in the tree. You can get old ebuilds from the attic but thats just the ebuilds.
Where do you recover the file hashes from?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Sun Nov 07, 2010 6:01 pm    Post subject: Reply with quote

what is a file hash?

Code:

genny store # emerge =sys-kernel/gentoo-sources-2.6.30   

 * IMPORTANT: 7 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

Calculating dependencies... done!                                                             

emerge: there are no ebuilds to satisfy "=sys-kernel/gentoo-sources-2.6.30".

idella@genny ~/bin $ sudo emerge =sys-kernel/xen-sources-2.6.31   

 * IMPORTANT: 7 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

Calculating dependencies... done!

emerge: there are no ebuilds to satisfy "=sys-kernel/xen-sources-2.6.31".


 * IMPORTANT: 7 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

_________________
idella4@aus


Last edited by idella4 on Sun Nov 07, 2010 6:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
avendesora
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1739
Location: Betelgeuse vicinity

PostPosted: Sun Nov 07, 2010 6:19 pm    Post subject: Reply with quote

NeddySeagoon wrote:
avendesora,

Thats true for things still in the tree. You can get old ebuilds from the attic but thats just the ebuilds.
Where do you recover the file hashes from?

Gah! :oops:
Good point, hadn't thought about that... There's probably somewhere out there with md5 or sha sums of the linux-2.6.x tarballs, but maybe the gentoo parts aren't that easy to find.
Although a quick google does find _very_ out of date mirrors that still have some of that (not sure how trustworthy though).

idella4, read this as a starting point on hashes/checksums. That article is not very comprehensive but it'll give you the idea.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Sun Nov 07, 2010 6:31 pm    Post subject: Reply with quote

I know what md5sum and sha and the like. Is a hash or hash file just a type of an alternate md5sum style algorithm?
Making a tar of /mnt/gentoo in btrfs. I didn't realise tar was sooooo slow.
_________________
idella4@aus
Back to top
View user's profile Send private message
avendesora
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1739
Location: Betelgeuse vicinity

PostPosted: Sun Nov 07, 2010 6:57 pm    Post subject: Reply with quote

idella4 wrote:
I know what md5sum and sha and the like. Is a hash or hash file just a type of an alternate md5sum style algorithm?

Please re-read the very first paragraph of that page. md5 & sha256 are just two examples of hash functions.
(And file hash =/= hash file. We're talking about finding/verifying file's hashes here. Hash files are something else entirely.)

tar's not inherently slow. Bottleneck is usually disk or network (or tape) i/o.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54334
Location: 56N 3W

PostPosted: Sun Nov 07, 2010 7:09 pm    Post subject: Reply with quote

avendesora, idella4,

Asking the gentoo infra guys, I was told the you can get the manifest/digest files along with the ebuilds in the attic.
These files will contain the hashes you need to validate the recovered source files for things no longer in the tree.
I've not tested.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Sun Nov 07, 2010 7:23 pm    Post subject: Reply with quote

Neddy,
you got me again. What is the attic? Never heard of that before.

Quote:

tar's not inherently slow. Bottleneck is usually disk


yep, just to add to the fun this is tar saving on /mnt/gentoo in btrfs. It could be btrfs slowing it or is the disk.
_________________
idella4@aus
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54334
Location: 56N 3W

PostPosted: Sun Nov 07, 2010 10:01 pm    Post subject: Reply with quote

idella4,

Every ebuild that has ever been in portage is stored here
Looking in development-sources which is a completely dead branch now, you find nothing. it says
Code:
Files shown:   0 (Show 145 dead files)


Click on the 145 dead files and you find the ebuids and digest files. Looking in the very first digest file file you find
Code:
MD5 1bdfb4a5a566970e689ac2f05f277dc7 linux-2.5.30.tar.bz2 28117198
Which is the file size and md5sum for 2.5.30.tar.bz2.

You can do the same digging for the files you have recovered from your btrfs. Use the hashes to validate your recovered files
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Mon Nov 08, 2010 7:00 am    Post subject: Reply with quote

NeddySeagoon,

thanks for the explanation. Can you continue explaining?
Quote:

Use the hashes to validate your recovered files


http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.6.30-r8.ebuild?hideattic=0&view=log

Quote:

Links to HEAD: (view) (download) (annotate)
Revision 1.9
Sun Sep 5 12:15:34 2010 UTC (2 months ago) by mpagano
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED

Old version cleanup
(Portage version: 2.1.8.3/cvs/Linux i686)

Revision 1.8 - (view) (download) (annotate) - [select for diffs]
Sun Feb 21 21:44:14 2010 UTC (8 months, 2 weeks ago) by mpagano
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7

Changing homepage of genpatches to finally close bug #293152
(Portage version: 2.2_rc63/cvs/Linux i686)



It continues on for all 9 revisions. ok, this is gentoo kernel talk. This is the page for gentoo sources 2.6.30-r8. I thought the r8 means revision number 8 of gentoo kernel 2.6.30. What on earth is going on with 9 more revisions listed for 2.6.30-r8???? There was never a gentoo-sources-2.6.30-r88.

In the first example of the dead development files, the Download link lead to the cited md5sum of kernel 2.5.30.
Code:

MD5 1bdfb4a5a566970e689ac2f05f277dc7 linux-2.5.30.tar.bz2 28117198


The download link of the above yields

Quote:

# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/Attic/gentoo-sources-2.6.30-r8.ebuild,v 1.8 2010/02/21 21:44:14 mpagano Exp $

ETYPE="sources"
K_WANT_GENPATCHES="base extras"
K_GENPATCHES_VER="9"
inherit kernel-2
detect_version
detect_arch

KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86"
IUSE=""
HOMEPAGE="http://dev.gentoo.org/~mpagano/genpatches"

DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"

pkg_postinst() {
kernel-2_pkg_postinst
einfo "For more info on this patchset, and how to report problems, see:"
einfo "${HOMEPAGE}"
}

not exactly the same, so you have me completely lost re finding the hashes to validate the recovered files.
The word hash has always left me out in the cold.
I can see that a hash is like an md5sum to check the validity or integrity of the file.
It's evident that on emerging a package, emerge includes a check on the pacakge file just as debian do with apt-get and fedora and centos do with yum.

Rather than what is the hash, where is the hash. The word hash does not appear within
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.6.30-r8.ebuild?hideattic=0&view=log.

Perhaps then I can set about selecting some sample packages to verify. Then I can move onto figuring out how to go about potentially checking 5,950 of them with a modified form of the acquired bash script..

Once and for all, can you differentiate between a hash and a hash file???

I'm tinkering with btrfs a little. Its features are snapshots and subvolumes. Do you understand these btrfs concepts. They are described as like a separate file system. I've created a couple and I'm just wondering what their real use or value is aimed at. A subvolume inherits the used space measurement of the parent btrfs file or partition and it can be mounted on a separate loop file and folder such as /mnt/btrfs, as does a snapshot which appears to make a copy or a set of links to the data of the root directory of the parent btrfs. What value does this really achieve? What I'm wondering is the following;

If I had saved each of my folders in the root of my gen2.img [of note: the kernels, a store.img, a tarall, /distfiles, /packages], would each sub-volume [about 10 in all] be protected from the breaking of the filesystem of the parent btrfs? i.e., the btrfs filesystem of /mnt/gentoo root becomes corrupt, yet each directory is contained in its own subvolume.
So e.g., Let's create a sub-volume folder in the root /subvol1, and in it I have placed /linux-2.6, in folder /subvol2, I place /linux-2.6.-30-r8, and so on.
So simply each kernel is contained and can be mounted in the subvolume that contains it.
Let's create /mnt/subvol[1-10]. Let's mount each subvol via -o loop on /mnt/subvol1 - /mnt/subvol10. Now the root of /mnt/gentoo btrfs goes corrupt.
Let's say the root of /mnt/gentoo contains the store.img [4gig] & the minimal install-amd64 tar.bz2 file [160 mb] and then the 10 subvolume folders.
So /mnt/gentoo goes corrupt contaminating proper management of the store.img & the tarball, being the only file content of the root.
Are the subvolumes shielded from the btrfs corruption in /mnt/gentoo root,
or
Do they simply inherit the corruption and are rendered equally useless? If so, what good are they? Why create a subvolume?


On an old note, my tinkering has lead to another query which stems from suseimg.tar.bz2. Remember we were both at a loss to figure what happened to a tar file going wrong. I was going to forget about it accepting suse was lost.
The size of the /mnt/gentoo is playing tricks in the course of making a mnt-gentoo.img.tar.bz2.
It may come to nothing, but for what it's worth I shall attempt to follow it through. See a new post in kernel & hardware.
_________________
idella4@aus
Back to top
View user's profile Send private message
avendesora
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1739
Location: Betelgeuse vicinity

PostPosted: Mon Nov 08, 2010 7:13 pm    Post subject: Reply with quote

If you apply a hash function (aka digest function, aka checksum function) to the contents of a file, you get that file's hash (the hash is the output of the hash function, usually represented as a long hex string).

What is important with that hash is that:
- any file that has the same _contents_ will have the same hash
And with a good hash function:
- any alteration of that file contents will result in a different hash
(obviously not mathematically true, but close enough for usual purposes)

So at some point linux-2.6.30.tar.gz was an official distfile.
Before publishing the ebuild, someone calculated the sha1, sha256 and rmd160 hash values of that tarball (verifying with what is posted on kernel.org), and stored those hash values in the Manifest file in the sys-kernel/gentoo-sources portage directory.
(There were digest files before that, but the Manifest replaced those I think.)

The Manifest file, and all its past versions, are retrievable at the urls mentioned by NeddySeagoon and yourself.
If you can find a revision of that Manifest file old enough to include linux-2.6.30.tar.gz, assuming the CVS has not been hacked, then you know those hash values for the real, known good, kernel tarball.
You then compare those values with the hash values of the file you have recovered. If all three match, chances are really really good that the file you recovered is good. If any of them do not match, you are _certain_ that it is corrupted.

In the CVS, you'll also find the old .ebuild files, and everything that is necessary to emerge that version of the kernel.
(That is what you posted: an .ebuild.)

As for snapshots there is tons of information in search engines. Try "filesystem snapshots", and look at the homepages/wikis of btrfs, ZFS, nilfs, VxFS (if you want a commercial example), AdvFS (a historical (but still relevant) example), ... (at the very least, look at the wikipedia entries for those filesystems, and their relevant links).

If you don't understand what you are doing with those subvolumes and snapshots, please spend the time to _read_ about them.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54334
Location: 56N 3W

PostPosted: Mon Nov 08, 2010 7:52 pm    Post subject: Reply with quote

idella4,
There were 9 versions of the gentoo-sources-2.6.30-r8.ebuild, from reading the log, mostly for keyword changes on more architectures. The version of the ebuild did not change as the keywording (and other changes) had no effect on already installed users.

AMD64 users don't really want to rebuild their kernel just because its SPARC keyword was changed.

If you go into Manifest you will see all the Manifest fies for gentoo-sources. Looking inside Version 1.815 you find lines
Code:
DIST genpatches-2.6.30-8.extras.tar.bz2 24978 \
RMD160 95e44fd010bf659a59087b91d95c7982e6877b3e \
SHA1 de8e4cc7fac2f445ac077928b868c4474c7a3012 \
SHA256 faaad5a9cf5c92d6d97843aed4cee8c20d431e9542628410cb0c75b7ea51bc88
DIST linux-2.6.30.tar.bz2 59435895 \
RMD160 72219f992c6266dfe78c6d803d0506c9db1e45b8 \
SHA1 5fb7f2ccdc59c57887d586971a157bee7af324d1 \
SHA256 d7b9f19b92fd5c693c16cd62f441d051b699f28ec6a175d1b464e58bacd8c78f


edit - line breaks added to make it easier on the eye

The line for EBUILD gentoo-sources-2.6.30-r8.ebuild is missing, so this file is not quite the one you want but you get the idea.
That gives you the file name, file size, RMD160 hash value, SHA1 hash value and SHA256 hash value for the file. Portage checks them all.

As an aside, md5sum is no longer used as its become trivial to generate md5sum collisions with any payload you like - but thats a whole new topic.
Thats why md5 is no longer used for password hashes too.

The hashes cover only the file(s) named. You cannot get hashes for the binary files (*.o and *.ko) or even for individual source code files for your kernel.
After validating the tarballs and recovering the .config files you can go through the normal kernel build proces to reproduce the kernel binaries.

In fact, its probably easiest to make yourself an overlay and put the kernel ebuilds and manifest files of interest into the overlay, put the recovered distfiles into /usr/portage/distfiles then try to emerge the kernels.
Portage will use the Manifest to check the files in the normal way.
As you may only have one Manifest file, you need to include every file in the Manifest in your overlay or portage will complain about missing files.
If you try to edit the Manifest file, portage will detect that too ...

Anyway, plenty of food for thought there.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Tue Nov 09, 2010 4:15 am    Post subject: Reply with quote

avendesora wrote:

you get that file's hash (the hash is the output of the hash function, usually represented as a long hex string).


well that was easy.

avendesora wrote:

As for snapshots there is tons of information in search engines.


roger that

NeddySeagoon wrote:

Looking inside Version 1.815


ok Neddy, how do you reach the leap from manifest page to selecting Version 1.815? On perusing briefly, the content of the Version pages appear to be mixed up, disorganized. How un-administration like and un-gentoo like. Looks as if you required a search on the Version* links to find anything related to 2.6.30. And then after all that, the actual file for 2.6.30 sources appears missing ???!!!???

NeddySeagoon wrote:

In fact, its probably easiest to make yourself an overlay and put the kernel ebuilds and manifest files of interest into the overlay


NeddySeagoon wrote:

put the recovered distfiles into /usr/portage/distfiles then try to emerge the kernels.


My m.o. is to define PORTDIR in /etc/make.conf and point it to /mnt/gentoo/distfiles like I had in the first place.

A year ago pappy was helping me to make an overlay for kde-3.5.9. I then lost interest in completing the exercise,
but I did get the overlay made. Now this moves onto a separate portage issue, perhaps making an excuse for a fresh post and wrapping this one up. Unlike you I don't normally get IMs. I'm sure you've deleted my past IMs to you from months ago, but I have yours and pappy's from the last year which covered making the overlay. The system on which I made the overlay is here;

Code:

idella@genny ~/bin $ sudo ls -l /mnt/images/images
Password:
total 22941692
-rw------- 1 root   root    2135957177 Feb  5  2010 Ubuntu-hardy-Feb-10.img.000
-rw------- 1 root   root    1826111673 Feb  5  2010 Ubuntu-hardy-Feb-10.img.001
drwxr-xr-x 3 idella idella        4096 Aug 17 08:49 gentoo-2007                               
-rw------- 1 root   root    2135914428 Apr 21  2010 gentoo-Apr-2010.img.000
-rw------- 1 root   root     339062061 Apr 21  2010 gentoo-Apr-2010.img.001
-rw------- 1 root   root    1976946816 Jul 19  2008 gentoo.img.000
-rw-r--r-- 1 root   root   15055310848 Nov  8 12:05 mnt-gentoo-Nov8.tar.bz2


As you can see I have a gentoo.img.000 from 2008, a pre-cursor to the gentoo-Apr-2010.img.000.

Now this gets interesting. I was required to use the gentoo.img.000 to acquire the portage content to make the overlay.
pappy clearly indicated that the eclasses required for a kde-3.5.9 were history. I happened to have them in the portage state of my partimage's image of gentoo.
HANDY TO KEEP RECORDS, JUST LIKE GENTOO ITSELF
I made the overlay and attempted to re-emerge my kde-3.5.9, and it started to work except that it kept pulling in more old non kde packages to attempt the emerge, then I simply lost interest in tinkering on the old system and put it on ice, in /mnt/images, named to reflect its content.

Now you say the old retired portage ebuilds can be found in the attic.
Is the attic a gentoo addition to the gentoo world since that attempt around a year ago?
The overlay is a good tip, only I still have some trouble getting my mind around the sense in the idea of doing all that for 7 gig of out-dated gentoo packages.


From the above, selecting the 2.6.30 kernel is put under threat because you discovered the actual gentoo-sources-2.6.30 is missing!!!
_________________
idella4@aus
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54334
Location: 56N 3W

PostPosted: Tue Nov 09, 2010 7:40 pm    Post subject: Reply with quote

idella4,

The attic has always been there. Ebuilds are made available under the GPL, which says something about providing source code to anyone who asks.
There is some limit of time, or the word 'reasonable' may be used. I don't recall exactly.

Gentoo is not obliged to provide copies of files that the Gentoo only mirrors. Go to the source of those files for that. e.g. kernel.org for kernels.

idella4 wrote:
because you discovered the actual gentoo-sources-2.6.30 is missing!!!
Not at all. You misunderstand. I did not look for any kernel source files, only for Manifest/Digests that you could use to validate your recovered kernel sources. Version 1.815 looked quite promising when I started to write the post but as I proceeded, I realised that the hashes for the kernel you were interested were not in that file. You need a newer version of the Manifest file.

They will be there somewhere.

I found version 1.815 by doing a binary search (approximately.) Which is a very fast search algorithm on an ordered list.
Look at the item in the middle of the list, decide which half of the list you need to search. Look at the item in the middle of that sublist ...

If you look in a later file, you will find what you need.

I suggested using an overlay, as its tidy and won't be overwritten by emerge --sync. I all depends on how much work you want to put into it.
Is it just to prove a point or do you actually want to validate and use the recovered data ?

As I have said before, you only need the .config files. Everythng else is available.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
idella4
Retired Dev
Retired Dev


Joined: 09 Jun 2006
Posts: 1600
Location: Australia, Perth

PostPosted: Tue Nov 09, 2010 8:31 pm    Post subject: Reply with quote

Neddy,

yes, sure. Can only say you have delivered again. I am puzzled why pappy didn't bring up the attic in the making of the overlay.

Quote:

They will be there somewhere.


Well ok, so you mean the search you did came up with some good & relevant examples, but didn't quite come up with the cited example of the kernel-2.6.30-r8. You mean I should pick up from where you left off? I am puzzled as to why the content appears mixed up. Perhaps it's just the order in which files were retired rather than strictly listing them in order?? I recall your binary search method. I take it the search still requires to find the ebuild for the example kernel-2.6.30-r8. I actually have such a record in my own old portage states or an image file. In fact I have the whole kernel-2.6.30-r8 in my gentoo image of April.

Is it just to prove a point or do you actually want to validate and use the recovered data ?

At this point, am really quite undecided. It has lead to picking up more about gentoo portage in the form of the attic, which I had not come across before, and hash. Always keen to get on top of gentoo's extensive structure a little more.
I shall mull it over for a while and decide in time. Any choice is purely arbitrary.

I thought I might get my suse back, but that was a false alarm. Like I said, I used to lose partitions and data years ago. I have not lost a thing except by accidental deletion until gen2.img and suse.img.tar.bz2. Losing data is something I have become sensitive about. I haven't had a drive fail like you obviously have in the past. I expect to never lose any data.
gen2.img was some months ago and it was always just replaceable gentoo data. suse.img really throws me since it was using tar exactly as I had before with no problem, correctly, and then it was 140 bytes in size. Quite frankly I'm more concerned with the principal of not losing data rather than the data.
Suse-11.3 is out, must be for some time. See my post in the btrfs discussion in gentoo chat.

I did delete gen2.img to clear the space required for examing the suse.img, so it's gone.
That's enough for this thread. Consider it done
_________________
idella4@aus
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54334
Location: 56N 3W

PostPosted: Tue Nov 09, 2010 9:22 pm    Post subject: Reply with quote

idella4,

The Manifest file changes every time there in a change to /usr/portage/<catagory>/package as it contains a list of files, their sizes and hashes in that directory and its subdirectories. Thats why there as so many versions of Manifest for gentoo-sources.

idella4 wrote:
Well ok, so you mean the search you did came up with some good & relevant examples, but didn't quite come up with the cited example of the kernel-2.6.30-r8.
Exactly. When I started my post, I fully intended to do the worked example for kernel-2.6.30-r8.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum