Computing.Net > Forums > Linux > Mounting partition problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Mounting partition problem

Reply to Message Icon

Name: satimis
Date: January 16, 2006 at 08:50:42 Pacific
OS: Knoppix LiveCD
CPU/Ram: Athlon1.4/512mb
Comment:

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 bytes

Device 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 Linux

without 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 systems

Other 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



Sponsored Link
Ads by Google

Response Number 1
Name: 3Dave
Date: January 17, 2006 at 08:38:33 Pacific
Reply:

What file system is it? Have you tried running fsck or reiserfsck on it?


0

Response Number 2
Name: satimis
Date: January 18, 2006 at 03:55:25 Pacific
Reply:

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


0

Response Number 3
Name: 3Dave
Date: January 18, 2006 at 06:20:12 Pacific
Reply:

You could do:
# dd if=/dev/hda8 of=/dev/hda7/partition.image

Alternatively you could create a smaller gzipped compressed image with something like:
# dd if=/dev/hda8 bs=1M | gzip -c - > /mnt/hda7/partition.image.gz

Have you got /sbin/fsck.ext3 that you could use instead of e2fsck?

Running "fsck.ext3 -b 8193 /dev/hda8" should hopefully repair your partition.


0

Response Number 4
Name: satimis
Date: January 18, 2006 at 08:56:19 Pacific
Reply:

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 so

It 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 bytes

Device 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 Unknown

The 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 bytes

Device 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 Linux

However /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/hda8

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>


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/hda8

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>


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


0

Response Number 5
Name: 3Dave
Date: January 18, 2006 at 09:35:20 Pacific
Reply:

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.txt

It 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?


0

Related Posts

See More



Response Number 6
Name: satimis
Date: January 18, 2006 at 18:26:39 Pacific
Reply:

Hi 3Dave,

After running;
root@1[knoppix]# fsck.ext3 -b 32768 /dev/hda8

and 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



0

Response Number 7
Name: 3Dave
Date: January 19, 2006 at 03:57:22 Pacific
Reply:

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 -


0

Response Number 8
Name: satimis
Date: January 20, 2006 at 03:16:20 Pacific
Reply:

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


0

Response Number 9
Name: 3Dave
Date: January 20, 2006 at 04:29:27 Pacific
Reply:

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!


0

Response Number 10
Name: satimis
Date: January 22, 2006 at 00:29:20 Pacific
Reply:

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 info

The 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/hda8

It 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



0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Mounting partition problem

e2fsck check on mounted partition? www.computing.net/answers/linux/e2fsck-check-on-mounted-partition/15156.html

mount partitions during boot www.computing.net/answers/linux/mount-partitions-during-boot/3228.html

share mounted fat32 or ntfs drives www.computing.net/answers/linux/share-mounted-fat32-or-ntfs-drives/14407.html