LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Hard disk failing?? (https://www.linuxquestions.org/questions/linux-hardware-18/hard-disk-failing-4175454509/)

rknichols 03-21-2013 08:33 AM

Quote:

Originally Posted by alaios (Post 4915780)
I can not copy the windows partitions through clonezilla software?

Yes, you can. The issue is that if you copy, for example, a 5GB filesystem into a 10GB partition, there is no tool that I have found that you can tell, "Expand this filesystem to fill the existing 10GB partition.) You would need to do something like, "Shrink the partition to 9.9GB, then expand the partition back to 10GB, adjusting the filesystem size each time." Personally, I try to avoid doing things that way. YMMV.

For ext2/3/4, using resize2fs to expand a filesystem to fill an existing partition is the default mode of operation.

clonezilla never changes the size of a filesystem. It will leave you with a small filesystem (same size as the original) sitting in your large partition.

alaios 03-23-2013 12:14 AM

Total Failure:
I have been launching clonezilla (which I found a terribly designed gui) and went to konsole

I entered root mode through sudo su -

and then I did e2fsck -fp /dev/sdb1

then I did

ddrescue -v /dev/sda /dev/sdb

that returned an error that /dev/sdb has data that would be lost and I have to use --force.
So I used
ddrescue -v --force /dev/sda /dev/sdb

when I returned back. The /dev/sdb had only three partitions out of 8.

I have read also those two tutorials here
http://www.ghacks.net/2010/08/01/clo...with-ddrescue/
http://dimitar.me/clone-disk-drives-with-ubuntu/

but I can not see why it failed so much.

Any help now?
Alex[COLOR="Silver"]

alaios 03-23-2013 02:57 AM

Hi, I would be happy if just the 320gb hard disk (source) is written as it in the 750gb (target) and leave the rest space unallocated, I will try to expand it later with other tools.

I tried yesterday launching with clonezilla (what a bad interface is that!!) and launched the terminal. What a total failure was that.


I entered root mode through sudo su -

and then I did e2fsck -fp /dev/sdb1

then I did

ddrescue -v /dev/sda /dev/sdb

that returned an error that /dev/sdb has data that would be lost and I have to use --force.
So I used
ddrescue -v --force /dev/sda /dev/sdb

when I returned back. The /dev/sdb had only three partitions out of 8.

I have read also those two tutorials here
http://www.ghacks.net/2010/08/01/clo...with-ddrescue/
Clone Disk Drives with Ubuntu using dd or ddrescue | dimitar.me

but I can not see why it failed so much.

Any help now?

my source disk now looks like:


Quote:

fdisk -l /dev/sda

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7de47de4

Device Boot Start End Blocks Id System
/dev/sda1 2048 24578047 12288000 27 Hidden NTFS WinRE
/dev/sda2 * 24578048 24782847 102400 7 HPFS/NTFS/exFAT
/dev/sda3 24782848 351562415 163389784 7 HPFS/NTFS/exFAT
/dev/sda4 351563776 625139711 136787968 f W95 Ext'd (LBA)
/dev/sda5 351565824 392525823 20480000 83 Linux
/dev/sda6 420814848 625139711 102162432 7 HPFS/NTFS/exFAT
/dev/sda7 392527872 396623871 2048000 82 Linux swap / Solaris
/dev/sda8 396625920 420812799 12093440 83 Linux

and the target disk is the:
Quote:

fdisk -l /dev/sdc
Note: sector size is 4096 (not 512)

Disk /dev/sdc: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 11400 cylinders, total 183143646 sectors
Units = sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000395d3

Device Boot Start End Blocks Id System

H_TeXMeX_H 03-23-2013 03:18 AM

So, are you trying to clone the disk from /dev/sda to /dev/sdb or to /dev/sdc ?

alaios 03-23-2013 03:30 AM

From sda to sdb. After I tried with ddrescue that failed (as I described) the hard disk on the currently installed linux system (sda) was recognized as sdc (that is the reason I had to to fdisk -l /dev/sdc)

H_TeXMeX_H 03-23-2013 04:24 AM

Can you run fdisk on /dev/sdb.

alaios 03-23-2013 05:56 AM

No, because there isīno such disk in the system

I was also concerded why the kernel gave the disk the name sdc and not sdb.... When I also launch Yast-> Partitioner, there is no there sdb, only sda and sdc.

IF you want I can reboot but I think the main concern is how I make ddrescue clone partition by partition... and why it failed producing 3 non-sense partitions.

regards
Alex

H_TeXMeX_H 03-23-2013 06:08 AM

That is unusual. You probably should reboot and try again. Make sure that both disks are recognized before trying to clone the disk.

alaios 03-23-2013 06:25 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 4917027)
That is unusual. You probably should reboot and try again. Make sure that both disks are recognized before trying to clone the disk.

Which command do you suggest me to run after both disks are recognized correctly as sda and sdb?

Alex

H_TeXMeX_H 03-23-2013 09:04 AM

Do take into account that SMART reported read failure meaning that cloning the partitions may not work no matter what tool you use. In other words, the disk is corrupt and trying to clone corrupt partitions will likely lead to corrupt partitions or it just won't work.

I recommend trying to backup your files and then just reinstall everything onto the new disk.

It may have been my mistake to assume that you were doing this to try to salvage your data. It is true that cloning the drive is a good thing to do, but you shouldn't expect the drive you clone to to be bootable and usable. Instead you should recover your files from there and then reinstall everything onto this new drive.

alaios 03-23-2013 09:53 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 4917109)
Do take into account that SMART reported read failure meaning that cloning the partitions may not work no matter what tool you use. In other words, the disk is corrupt and trying to clone corrupt partitions will likely lead to corrupt partitions or it just won't work.

I recommend trying to backup your files and then just reinstall everything onto the new disk.

It may have been my mistake to assume that you were doing this to try to salvage your data. It is true that cloning the drive is a good thing to do, but you shouldn't expect the drive you clone to to be bootable and usable. Instead you should recover your files from there and then reinstall everything onto this new drive.

Indeed that might be true. I would try again with dd_rhelp and see if there is anything coming out, if not I would say that the minimum is to copy just the hidden partition where the windows 7 installation resides (my opensuse is already downloaded and my data are backed up). Do you have any tips on how to copy the first hidden partition? Is there something important about a hidden partition or is just a normal one? Alex

rknichols 03-23-2013 10:14 AM

The output from "fdisk -l" makes it appear that the new drive has a 4096-byte logical sector size. What is the make and model for that drive, and what is the output from "hdparm -I /dev/sdc | grep 'Sector size'". Drives with a 4096 logical sector size are only supported by recent kernels and tools, and even then are very bleeding edge. It well could be that clonezilla does not support them. (Drives with 4096 physical / 512 logical are not a problem except for alignment issues).

The drive probably migrated from sdb to sdc because you unplugged it (as sdb) while there was still some open reference to it. That leaves sdb in use, and when you reconnect the drive you get the next available device number.

alaios 03-23-2013 01:32 PM

Quote:

Originally Posted by rknichols (Post 4917156)
The output from "fdisk -l" makes it appear that the new drive has a 4096-byte logical sector size. What is the make and model for that drive, and what is the output from "hdparm -I /dev/sdc | grep 'Sector size'". Drives with a 4096 logical sector size are only supported by recent kernels and tools, and even then are very bleeding edge. It well could be that clonezilla does not support them. (Drives with 4096 physical / 512 logical are not a problem except for alignment issues).

The drive probably migrated from sdb to sdc because you unplugged it (as sdb) while there was still some open reference to it. That leaves sdb in use, and when you reconnect the drive you get the next available device number.

This is a normal 2.5 inches western digital 750gigabytes hard disk! If I did something wronng that should be easily fixable with some command line commands.
1. Which one should I try?

The target is just to clone only the first hidden windows partition to the hard disk and just restore windows from scratch. Installing linux then would be quite straightforward.


2. What is the ddrescue command for cloning the first partition of sda1 to sdb1?

3. Should I have in advance created an almost similar partition size to the target disk? If yes how I can do that with commands like fsck?

Regards
Alex

rknichols 03-23-2013 06:54 PM

What exact model number, please.

alaios 03-24-2013 03:22 AM

Western Digital WD7500BPKT Black 750GB . Where I can find the model number?


All times are GMT -5. The time now is 09:28 AM.