Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Broken partition table? reiserfs_fill_super error
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
TemplarKnight
Guru
Guru


Joined: 14 Jun 2005
Posts: 311
Location: Greece/patras/

PostPosted: Sun Mar 04, 2007 7:22 pm    Post subject: Broken partition table? reiserfs_fill_super error Reply with quote

Ok, i seem to have blown up one of my reiserfs partition :( , this is what i did:
I wanted to back up the entire / with rsync so i reformated a new partition on another hard disk (previously it was NTFS) using fdisk and doing mkreiserfs afterwards. Up until then all was ok, but i was stupid enough not to reboot the system before starting the rsync procedure. Even more, i didn't check to see if the files were copied succesfully i.e. do some browsing to the new partition containing my precious data...

After that i booted from the gentoo universal cd 2006.1 and formated my /. However when i mount the partition that is supposed to be containing the rsync backup, the data seem to be blown away somehow. Just take a look:

Code:
chameleon ~ # ls /mnt/floppy/
?         ?.?f?         00000 no.ne?  ?f???4??.t    bg_chart..pn  e_bottom._1.  jd?.???       pacer.pn.g    ???.?f?       ?f?. ??  ?f?.h
?         ?.?f?         0w?           ?p?           bg_grid..png  e_bottom._5.  l_meter..png  png.ete       ???.?f?       ?f?. ??  ?f?.h??
?.?       ?.?f?         2 3 1",?." ?  ?v?           bg_panel..pn  e_left.x.pm   l_net_le.ds.  png.tim       ??s??i??.`??  ?f?. ??  ?f?.h??
?.?       ?gama.???     2.png         ?v?           bg_panel..pn  e_left_4..pn  l_net_le.ds.  r *magic.k[]  ???.?f?       ?f?.0    ?f?.h??
?.?       ?             2w?.???       ?v?.dec       bg_panel..pn  e_right..png  l_panel..xpm  r_horiz..png  ?p?.?         ?f?.0    ?f?.h??
?.?       ?.?           3.png         ?w?s?+.???    bg_timer..pn  e_side.p.ng   llmrc         rid.png       ?p?.???       ?f?.8??  ?f?.p
?.?       ?.)           4 1",?". c    ??k????6.m??  bkgd???a.?    e_top_2..png  llmrc         s.???         ?f?           ?f?.???  ?f?.p??
?.?       ??.?s?        4528718d.673  ???e?         button.p.ng   e_top_4..png  llmrc_2       sq?.?         ?f?           ?f?.???  ?f?.x
?.?       ?"x c gr.ay8  8??.?f?       ???e?         button.p.ng   emeter.*.t    llmrc_4       swap.png      ?f?           ?f?.???  ?f?.x??
.
.
.


fdisk for this disk gives me:
Code:
chameleon ~ # fdisk -l /dev/hdb

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1               1        7296    58605088+  83  Linux
/dev/hdb2            7297        9729    19543072+  83  Linux


The strange thing is that the partition is mounted as vfat 8O :
Code:

chameleon ~ # mount
.
.
/dev/hdb2 on /mnt/floppy type vfat (rw)


When i try to mount as reiserfs i get:
Code:

chameleon ~ # mount -t reiserfs /dev/hdb2 /mnt/floppy/
mount: wrong fs type, bad option, bad superblock on /dev/hdb2,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so


And of cource dmesg gives:
Code:

chameleon ~ #  dmesg|tail
.
.
ReiserFS: hdb2: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on hdb2



I strongly believe that this was caused because i didn't reboot the system after the fdisk operation (since i had hdb1 already mounted).

Is this situation beyond repair??
Is the partition tabled somehow screwed and how can i fix it?
How come that the partition gets mounted as vfat since previously it was formated as NTFS? I would expect NTFS of reiserfs but not vfat :?

I hope for an answer :(
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Sun Mar 04, 2007 7:36 pm    Post subject: Reply with quote

oh, dear, oh, dear. that doesn't look good.

Your only hope as far as I can see is to try to open one of the files in an appropriate program, like one of the .png's (if that's what they really are) with gimp which should be able to deal with lack of extension even, should that be true of some of the files.

But I do wonder whether if the filenames are incorrect the data in the files is also garbled?

That is, unless you actually wanted to mount hdb1 or something... or unless you used a version of reiserfs that the disc you booted from didn't support (??)
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
TemplarKnight
Guru
Guru


Joined: 14 Jun 2005
Posts: 311
Location: Greece/patras/

PostPosted: Sun Mar 04, 2007 7:45 pm    Post subject: Reply with quote

erik258 wrote:


Your only hope as far as I can see is to try to open one of the files in an appropriate program, like one of the .png's (if that's what they really are) with gimp which should be able to deal with lack of extension even, should that be true of some of the files.

Actually no, i can't open any of them. In fact some of them have huge sizes e.g. 1,8 GB 8O and can't be images..
I think this partition is really garbled as you said :(
I also noticed that the filesize of the mounted partition is far less (~5,7GB) than the previous / i backed up (~10GB)

erik258 wrote:

That is, unless you actually wanted to mount hdb1 or something... or unless you used a version of reiserfs that the disc you booted from didn't support (??)


I don't see this to be possible, i am using now the same reiserfsprogs version that i used before reformating..
Is the reiserfsck --rebuild-sb or the reiserfsck --rebuild-tree an option here? Or it's gonna make things even worse?
Any opinions :?:
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Mar 04, 2007 7:53 pm    Post subject: Reply with quote

What happened is ... kernel had still your old partition table when you formatted it with Reiser and copied the data. After reboot kernel read the new partition table and everything turned inevitably into big mess. The only idea I have is to restore your previous partition table in hope things fall back into place. Obviously you need to change partition type. And back it up with dd first.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Sun Mar 04, 2007 8:00 pm    Post subject: Reply with quote

i wouldn't try rebuilding the reiserfs tree or anything just yet. for one thing, i'm not so sure this partition got formatted properly. The funny thing is, you assumedly created a reiserfs partition somewhere and that does account for new files on this particular partition, but why wouldn't you have problems when you copied them over in the first place?

forgive me for getting stuck on this tangent, but you're positive you didn't want to use the big partition, hdb1?


So you created a new partition hdb2 and didn't restart, therefore you're partition table wasn't synced up with the operating system... yeah, /dev/hdb2 may not be a particularly working device at that point i guess....

If i may ask, why use fdisk in this case? you only deleted hdb2 and then created another of the same size right? You could have just reformatted ... or maybe I'm not understanding the roll of hdb on your system. I am not particularly optimistic that i'll be able to help you, but i do feel like i'm not positive what's going on here. Is /dev/hdb1 your old root fs and /dev/hdb2 your backup that got marred?
Quote:

I also noticed that the filesize of the mounted partition is far less (~5,7GB) than the previous / i backed up (~10GB)

well, the numbers from fdisk you posted show that hdb2 is about 20 gigs and hdb1 about 60. What does df show? (W/ hdb2 mounted of course)
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
TemplarKnight
Guru
Guru


Joined: 14 Jun 2005
Posts: 311
Location: Greece/patras/

PostPosted: Sun Mar 04, 2007 8:27 pm    Post subject: Reply with quote

erik258 wrote:
i wouldn't try rebuilding the reiserfs tree or anything just yet. for one thing, i'm not so sure this partition got formatted properly. The funny thing is, you assumedly created a reiserfs partition somewhere and that does account for new files on this particular partition, but why wouldn't you have problems when you copied them over in the first place?

That's really a good question. As far as i recall, the rsync process completed with no errors whatsoever. In fact that might be the reason i didn't recheck if the files where actually copied - they must have been.

erik258 wrote:

forgive me for getting stuck on this tangent, but you're positive you didn't want to use the big partition, hdb1?

hdb1 is exactly in the same shape as it was before the whole procedure. It contains other stuff which i can perfectly browse.


erik258 wrote:

If i may ask, why use fdisk in this case? you only deleted hdb2 and then created another of the same size right? You could have just reformatted ... or maybe I'm not understanding the roll of hdb on your system. I am not particularly optimistic that i'll be able to help you, but i do feel like i'm not positive what's going on here. Is /dev/hdb1 your old root fs and /dev/hdb2 your backup that got marred?

I think i used fdisk cause the hdb2 partition was not a linux one (i.e. type 83) but something else which i don't recall. I used to run Vista from hdb2 for one time or two but got bored of em :roll: . No i didn't change the hdb2's size, its 20GB or something close..


chameleon ~ # df
...
/dev/hdb1 58603260 53057904 5545356 91% /home/birbilakos/uploads
/dev/hdb2 19533504 5950624 13582880 31% /mnt/floppy

hdb1 is of 60GB and hdb2 of 20. Also hda1 was my / partition and not hdb1. Thanks :)
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Sun Mar 04, 2007 8:35 pm    Post subject: Reply with quote

Jaglover wrote:
What happened is ... kernel had still your old partition table when you formatted it with Reiser and copied the data. After reboot kernel read the new partition table and everything turned inevitably into big mess. The only idea I have is to restore your previous partition table in hope things fall back into place. Obviously you need to change partition type. And back it up with dd first.


So if I were to delete a partition and recreate the exact same partition with fdisk, and not change the partition type (so the partition table is updated/unsynced in the same way, but it isn't actually different in the data it contains), do you think I could proceed to reformat and would everything be groovy in that case?

I'd like to see the situation like this: the partition table is out of sync and when the partition is mounted after being formatted reiserfs, the old partition table data (probably NTFS fs type, although all other partition info may be the same). But I don't understand why the mount would work at all, when everything is so out of sync. Instead, it seems to me that either the mount would fail or the mkreiserfs would fail. Why not?
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Mar 04, 2007 8:52 pm    Post subject: Reply with quote

I think this out-of sync term is not the best perhaps. Before reboot the kernel still had a partition table - the old one. Everything was done as it was still valid. This is why mkfs and copy worked. Actually, before reboot everything was as normal as it could, the new partition table wasn't valid yet.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
TemplarKnight
Guru
Guru


Joined: 14 Jun 2005
Posts: 311
Location: Greece/patras/

PostPosted: Sun Mar 04, 2007 9:01 pm    Post subject: Reply with quote

So there is nothing i can do to get the data back??
Also, how can i set the old partition table back??
Changing the hdb2 type back to NTFS of VFAT??
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Sun Mar 04, 2007 9:04 pm    Post subject: Reply with quote

hmm. ..

In that case, TemplarKnight, I suggest you try really hard to restore the partition table to the way it looked before doing this. Then maybe, just maybe, this will start working again.

Does that idea make sense to you?
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
TemplarKnight
Guru
Guru


Joined: 14 Jun 2005
Posts: 311
Location: Greece/patras/

PostPosted: Sun Mar 04, 2007 9:29 pm    Post subject: Reply with quote

ok , i tried setting the hdb2 type both to vfat (type: b) and to NTFS (type: 86), rebooted to the new partition table but still the same. Partition hdb2 can only be mounted as vfat and files appear crappy.

Any suggestions?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Mar 04, 2007 9:35 pm    Post subject: Reply with quote

Try testdisk. As far as I understand you formatted a partition to Reiser while partition type was something else. My knowledge on this matter is not deep enough to tell you what exactly to do. :(
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Sun Mar 04, 2007 11:29 pm    Post subject: Reply with quote

i tried to reproduce this with a usb flash drive, and got a rather obscure error
Quote:
reiserfs_create_journal: cannot create a journal of 8193 blocks with 18 offset on 5040 blocks

upon creation of the reiserfs filesystem. I used vfat, since I can create filesystems of that type, to emulate the vista filesystem, which was probably EFI if it was vista. I don't exactly understand
http://technet2.microsoft.com/WindowsVista/en/library/3379222a-9133-4f18-9b36-848e2e1a8a891033.mspx?mfr=true
but i did notice
Code:

 ee  EFI GPT
 ef  EFI (FAT-12/16/


as partition types in fdisk.
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Mon Mar 05, 2007 12:06 am    Post subject: Reply with quote

From the article you linked to:
Quote:
An EFI partition type is not created if an EFI partition type is already present on the system, or the format of the disk is of type MBR.

Looks like not only the partition type but also partition table type was overwritten/changed.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
TemplarKnight
Guru
Guru


Joined: 14 Jun 2005
Posts: 311
Location: Greece/patras/

PostPosted: Mon Mar 05, 2007 3:43 pm    Post subject: Reply with quote

Ok people, thanks you all for the effords :)
I managed to recover some of my files doing at first:
reiserfsck --rebuild-sb
and afterwards:
reiserfsck --rebuild-tree

After the first command i could save some data from /var/www/... (apache stuff) which luckily remained untouched. After the second command, reiserfsck created a lost+found directory which contains some 25000 dirs+files 8O . All these files and folders contain cryptic numbers (i guess they are leaves' numbers or sthg like that...) but there IS actually some logic behind this. Folders and files with similar starting numbers seem to be "close" as far as the beginning filesystem hierarchy is concerned. The procedure also precerved the file's/folder's ownership which makes things easier to search for files.

So i finally managed to save some (not all) of my files, since, even though i found some of them (their names remained correctly) they seem to be damaged somehow. Anyways... i took my lesson i guess :? : PLEASE REBOOT AFTER USING FDISK AND BEFORE USING THE NEW PARTITION TABLE!! :roll:
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Mon Mar 05, 2007 6:01 pm    Post subject: Reply with quote

I can feel your pain, I did same thing some time ago. After trying it in a hard way without much success I discovered testdisk, it guessed and restored my lost partition entry with ease. I did not have EFI, do not know if testdisk can handle this.
hdparm -z /dev/xxx will validate new partition table without reboot. Disk must have no mounted partitions though.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
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