Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi folks,
Have a newly partitioned HD with following config;
root@ttyp0[knoppix]# fdisk -l
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 77 514080 82 Linux swap
/dev/hda3 78 1415 10747485 83 Linux
/dev/hda4 1416 4865 27712125 5 Extended
/dev/hda5 1416 2510 8795556 83 Linux
/dev/hda6 2511 3485 7831656 83 Linux
/dev/hda7 3486 4216 5871726 83 Linux
/dev/hda8 4217 4865 5213061 83 Linuxwithout OS installed.
/dev/hda5, /hda6/, hda7 and /hda8 all have data files. All partitions can be mouted previously on running Knoppix 4.0 LiveCD.
An hour before ran Knoppix 4.0 to browse Internets and have some files saved on /dev/hda8. Those files were not download on Internet. Just copied some text/information from Internet on existing files on /dev/hda8. The PC/Knoppix LiveCD worked without problem and was turned off later.
Now after turning on the PC and starting Knoppix LiveCD it was found /dev/hda8 could not be mounted.
root@ttyp0[knoppix]# mount /dev/hda8 /mnt/hda8
mount: wrong fs type, bad option, bad superblock on /dev/hda8,
or too many mounted file systemsOther partitions can be mouted without problem. The data/files on them can be read.
Please advise how to fix this problem.
TIA
B.R.
satimis

Hi 3Dave,
> What file system is it?
ext3> Have you tried running fsck or reiserfsck on
> it?
No.I ran;
# e2fsck -f /dev/hda8
e2fsck 1.38 (30-Jun-2005)
e2fsck: Filesystem revision too high while trying to open /dev/hda8
The filesystem revision is apparently too high for this version of e2fsck.
(Or the filesystem superblock is corrupt)The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
- - - END - - -Before running "e2fsck -b 8193" I need to backup this partition (/dev/hda8) to /dev/hda7 which has 5.6G available space. I'm trying to figure out what options on dd command should be up.
# dd if=/dev/hda8 of=/dev/hda7
would overwrite /dev/hda7 partition with the data from /dev/hda8 ending up with two identical and corrupted partitions. I need to create all data on /dev/hda8 as a "FILE" over on hda7, not overwrite the whole /dev/hda7. I looked at "man dd" but haven't arrived a conclusion yet. Could you shed me some light?
There are several non-important working files on /dev/hda7. I could delete them.
TIA
B.R.
satimis

You could do:
# dd if=/dev/hda8 of=/dev/hda7/partition.imageAlternatively you could create a smaller gzipped compressed image with something like:
# dd if=/dev/hda8 bs=1M | gzip -c - > /mnt/hda7/partition.image.gzHave you got /sbin/fsck.ext3 that you could use instead of e2fsck?
Running "fsck.ext3 -b 8193 /dev/hda8" should hopefully repair your partition.

Hi 3Dave,
On mounting /dev/hda7;
root@1[knoppix]# mount -t ext3 /dev/hda7 /mnt/hda7
mount: wrong fs type, bad option, bad superblock on /dev/hda7,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or soIt gave me a shock. /dev/hda7 can be mounted previously but failed this time. Continued.
root@1[knoppix]# fdisk -l
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Warning: invalid flag 0x4f88 of partition table 5 will be corrected by w(rite)Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/hda1 * 2089 4191 16881607 83 Linux
/dev/hda2 2102 4255 17291552 82 Linux swap / Solaris
/dev/hda3 2166 5593 27524957 83 Linux
/dev/hda4 3504 6954 27712381 5 Extended
/dev/hda5 ? 167652 114771 1722716809 d1 UnknownThe output gave me a further shock.
Then I mounted /dev/hda1, hda3, hda5, hda6 respectively and read their content with "ls" command. All worked without problem.
I mounted /dev/hda7 again. This time it worked and its content can be read with "ls".
root@1[knoppix]# fdisk -l
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 77 514080 82 Linux swap / Solaris
/dev/hda3 78 1415 10747485 83 Linux
/dev/hda4 1416 4865 27712125 5 Extended
/dev/hda5 1416 2510 8795556 83 Linux
/dev/hda6 2511 3485 7831656 83 Linux
/dev/hda7 3486 4216 5871726 83 Linux
/dev/hda8 4217 4865 5213061 83 LinuxHowever /dev/hda8 still could not be mounted.
Umounted all partitions except /dev/hda7 and ran;
root@1[knoppix]# dd if=/dev/hda8 bs=1M | gzip -c - > /mnt/hda7/partition.image.gz
dd: reading `/dev/hda8': Input/output error
3378+1 records in
3378+1 records out
3542679552 bytes transferred in 1301.761987 seconds (2721450 bytes/sec)
root@1[knoppix]# fsck.ext3 -b 8193 /dev/hda8
e2fsck 1.38 (30-Jun-2005)
fsck.ext3: Bad magic number in super-block while trying to open /dev/hda8The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
root@1[knoppix]# e2fsck -b 8193 /dev/hda8
e2fsck 1.38 (30-Jun-2005)
e2fsck: Bad magic number in super-block while trying to open /dev/hda8The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
Still could not fix the problem. Whether I have to use another higher number? If YES what number shall I try?
Besides on the command line ".... gzip -c - > ....."What is the "-" (hyphen) used for?
B.R.
satimis

You can use other superblock numbers...have a search on the net, can't remember off hand.
The "-" pipes stdout from the previous command to the next one, another example:
$ cat somefile.txt | grep string -
The above will pie the output of "cat somefile.txt" to grep which will then search it for "string". It is the same as:
$ grep string somefile.txtIt sounds as though your hard drive may be failing. Have you tried physically removing it and then putting it back, reseating all the cables etc?

Hi 3Dave,
After running;
root@1[knoppix]# fsck.ext3 -b 32768 /dev/hda8and answering several questions the partition revived. It can be mounted with its data retrievable. Tks.
FYI: for larger filesystems it is 32768 or 98304 or 32768 * {3,5,7}^n by default.
The power cable of the HD rendered into problem occasionally for unknown reason. Sometimes I have to replug it serveral times before it can work. The power was on with the HD turning but the PC can't read its content. Another time the screen hung during working, the HD still turning. I checked another HD on this PC with the same power cable which is an extension. It also rendered into the same problem occasionally. I think this extension power cable has to be changed. I'll get a new one from computer shop later.Another problem is the Knoppix 4.0 LiveCD. Many times it was difficult to boot. I have to eject the CDRom tray several time before getting it booted. Other LiveCD won't have the same problem on the same CDRom. Would it be necessary to download another ISO image and burned another Knoppix 4.0 LiveCD?
Coming to the compressed file on /dev/hda7, can I ran; (after cd /mnt/hda7)
# gzip -d partition.image.gz /mnt/hda8
to restore the data in case of need, or to another partition having sufficient space. Can I restore it in the same partition?
TIA
B.R.
satimis

Glad you got it fixed. Thanx for the superblock numbers, I'll store that away somewhere.
Re Knoppix, if it boots sometimes but not others I don't think downloading another image would help. Maybe it is due to a similar reason as to why your hard drive was failing....perhaps you need to buy a new PSU? Burning the ISO onto a different disc and at a slower speed may help.
To restore the image to your partition you will need to use dd again, eg:
# gunzip partition.image.gz | dd bs=1M of=/dev/hda8 -

Hi 3Dave,
Yes, I'll change the PSU later. I have a spare case.
Tks for your advice on restore command. I'll test it later.
B.R.
satimis

You may be interested in Ghost for Unix/Linux which boots off a floppy and does pretty much the same as dd & gzip above but also allows for backing up to an FTP server. If you check out the code in the scripts (also listed here: http://www.feyrer.de/g4u/g4l.html) then you should be able to run the commands by hand.
http://www.feyrer.de/g4u/
http://freshmeat.net/projects/g4l/NB If you are going to backup by hand, do test the commands I gave above as I didn't myself. The last thing you want is to find out that you can't restore it when you really need to!

Hi 3Dave,
I tested following command to restore the image to another partition /dev/hda6;
# gunzip partition.image.gz | dd bs=1M of=/dev/hda6 -
and found something strange.
Remark: the image was on /dev/hda7
Steps performed
# mount -t ext3 /dev/hda7 /mnt/hda7
# cd /mnt/hda7
# gunzip partition.image.gz | dd bs=1M of=/dev/hda6 -
dd: unrecognized option ‘-’
refer‘dd --help’for infoThe PC continued to work with HD light on indicating the later turning
After a while following warning popup
gunzip: partition.image: No space left on device# mount /dev/hda6 /mnt/hda6
# df -hT /mnt/hda6
Filesystem Type size used avail used%
/dev/hda6 ext3 7.4G 33M 7.0G 1% /mnt/hda6
# df -hT /mnt/hda7
Filesystem Type size used avail used%
/dev/hda7 ext3 5.6G 2.7G 2.6G 52% /mnt/hda7# mount -t ext3 /dev/hda8 /mnt/hda8
# df -hT /mnt/hda8
Filesystem Type size used avail used%
/dev/hda8 ext3 4.9G 1.2G 3.5G 25% /mnt/hda8It shows the data before compression 1.2G. There should have sufficient space on /dev/hda6
Whether the image must be restored to its original partition?
I haven't tried the command without "-" before sorting out the above.
B.R.
satimis

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |