Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Hosed my home directory



Dave M G writes:

 > Stephen,
 > 
 > Thanks for replying.
 > > mount -n -o remount,rw /   # / must be declared in /etc/fstab
 > > mount /home
 > 
 > I got this far, and it said:
 > mount: special device 
 > /dev/disk/by-uuid/b9a08a1c-c538-479d-a3d3-f366-cd67aa80 does not exist.

Gah.  Maybe somebody else can help you but that's beyond my ken (I've
seen this kind of thing before, but I don't know the details and don't
have time to look it up).

 > Not knowing what else to do, I typed in "fsck".  Then it said:

That was the right thing to do.  You can always tell fsck not to
correct any of the errors, and (with the exception of extreme hardware
frailty such that merely reading the disk causes harm -- pretty rare)
you're back where you started.  However, fsck errors tend to cascade;
there may be thousands of them.  It can take a very long time to press
Y or N for each!  Ctrl+C should get you out with no changes, too.

 > gsck.ext3: Bad magic number in super-block while trying to re-open /dev/hda1
 > e2fsck: io manager magic bad!
 > 
 > My magic is bad? Am I not performing the correct sacrificial rituals?

The "magic number" is a specific pattern of bits in a particular data
structure that identifies that data structure.  For example, every PNG
file starts with a binary byte with value 137 followed by the three
characters "PNG".  So you can rename your PNG file to "mr.t" and if
you say "file mr.t" the file program will see that and tell you "mr.t
is a PNG file".  Unlike Windows Explorer, which will tell you "MR is a
T file."  This use of the term "magic" is so common that when they
refactored the file program into a UI module and a library for
recognizing data structure ids, they called the latter "libmagic".

It seems to me that most likely everything is screwed *as a data
structure*.  IIRC, the "by-uuid" namespace is more magic.  This magic
is written in the header area, in the case of a diskpartition in the
partition header.  This allows mount to automatically recognize which
partition goes where, even if (for example) it's on removable media,
so "/dev/cdrom" doesn't tell you whether to mount it on
/.gf-dont-need-to-see-this/adult-video, to put it on ~/family-album,
or to not mount at all because it's a music CD.  When you reformatted,
you probably erased the UUID (universal unique identifier), so as far
as the system is concerned, it doesn't exist.

Now, since the superblock *also* got reformatted, the magic in the
superblock got erased.  Thus the "bad magic" message, which (if I am
correct) actually means "no magic here, boys, move along now".

Sooo ... you need to rebuild fstab from scratch, and you need to
reformat that partition as a filesystem with mkfs.  I could tell you
how to do that manually, but you would lose any modern automation that
Ubuntu has built in.  I don't need no steenkin' Ubuntu myself, but
since you're happy with Ubuntu, I have to recommend keeping Ubuntu
happy. :-)  Maybe somebody else can explain the Tao of Ubuntu.

Alternatively, if there's no data you're worried about, you could just
start from zero and reinstall as if it were an empty disk.  If there's
stuff that is on the root partition, you'd want to back that up.  If
there's stuff on the mythtv partition, I think you'd better bring the
disk to a meeting and see if somebody has good enough debugfs-fu to
get it back for you.  Not a good bet, but hard drives aren't all that
heavy.

Based on the above, I think it's pretty likely that your disk hardware
is still in good shape.  However, Ken's opinion that it looks like
hardware problems leading to disk corruption is certainly plausible.
Think about how much you care about the data that's going to go on the
disk and decide how conservative you want to be.  Following Ken's
advice is very conservative; it's hard to go wrong that way.  But you
do have to get more reliable storage to make up for it.




Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links