12.2 - how to restore previous partition without reformating.

As I was testing “REDO BACKUP”, I try to restore the system after I backed up sda1 on which there is the system files but without /root and /home which are on separate partition ( sda2, sad3).
After restoring sda1, it appear that sda2 and sda3 became unknown from the system.
Other partitions in the extended partition are present and known from the system ( swap, /tmp, /my_data ) .
For sda2 and sda3 the sizes are good but FS type is blank and label is blank.

As this could happens on a production system, using a live cd, is there a way to re-activate previous partitions without formatting them as during install.
When I try this, I get an error from the yast2-partition tools :

It is not allowed to assign a mount point to a device with non existent or unknown file system.

Help is welcome.

the output of cat /etc/fstab and fdisk -l would help understanding your partition table. you could mount them if they are physically attached to the machine and you know which is the right partition to be mounted and where. You don’t need to reformat the partitions, even during installation, but if you choose your saved /home it will be messed up(partially overwritten) with an empty /home partition. You can create a partition for home and then copy the backup of your home to the new created home with all your custom settings.

And do you realy have a seperate partition for /root? What is that for?

Well, in any case, we will see in your output as asked above.
It would also be nice when you told what sort of backup you made. “Making backups” is a very general term that can include among other methods:
. writing down things on paper.
. printing out files.
. copying files (rsync, tra, …) to other media (disks, tapes, DVDs, …)
. copying partitions (on byte level, often called cloning).
. the same on complete disks (thus inclusing the partitioning).
. maybe more?

From my live dvd

linux:~ # mount -t ext4 /dev/disk/by-id/ata-ST3320820AS_9QF6JA2A-part2 /root 
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail or so
linux:~ # 
linux:~ # dmesg | tail
 4782.443161] EXT4-fs (sda2): VFS: Can't find ext4 filesystem
linux:~ # 

linux:~ # parted /dev/sda 'print'
Model: ATA ST3320820AS (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  64.4GB  64.4GB  primary   ext4            boot, type=83
 2      64.4GB  118GB   53.7GB  primary                   type=83
 3      118GB   213GB   94.5GB  primary                   type=83
 4      213GB   320GB   107GB   extended                  lba, type=0f
 5      213GB   217GB   4310MB  logical   linux-swap(v1)  type=82
 6      217GB   238GB   21.5GB  logical   ext4            type=83
 7      238GB   320GB   81.6GB  logical   ext4            type=83

linux:~ # 
linux:~ # mke2fs -n /dev/sda2
mke2fs 1.42.4 (12-June-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3278576 inodes, 13108992 blocks
655449 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
401 block groups
32768 blocks per group, 32768 fragments per group
8176 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424

linux:~ #

And I could not found a good backup of Superblock.

I am testing REDO BACKUP to backup the system files without data.
I call data every things that belong to users ( root user, peter , paul and other ) including script and other things kept in ~/bin.
So I want tro restore the system without restoring /home nor /root.

As I said “as this could happens on a production system, using a live cd, is there a way to re-activate previous partitions without formatting them as during install.”
Just I want to do is to recreate the lost partition without loosing data, the same way as when creating a new install and instruct the partition tools to create the home partition and the root user partition without formating them.

On 2013-03-04 10:46, jcdole wrote:
>
> dmera;2531650 Wrote:
>> you could mount them if they are physically attached to the machine and
>> you know which is the right partition to be mounted and where.
>
> From my live dvd
>
> Code:
> --------------------
> linux:~ # mount -t ext4 /dev/disk/by-id/ata-ST3320820AS_9QF6JA2A-part2 /root
> mount: wrong fs type, bad option, bad superblock on /dev/sda2,
> missing codepage or helper program, or other error
> In some cases useful info is found in syslog - try
> dmesg | tail or so
> linux:~ #
> --------------------
>

Why are you using /root as a mount point? That will destroy your session.

> Code:
> --------------------
> linux:~ # dmesg | tail
> 4782.443161] EXT4-fs (sda2): VFS: Can’t find ext4 filesystem
> linux:~ #
>
> --------------------

Well, maybe it is not ext4. Try to find out what it is via


file -s /dev/sda2

>
> Code:
> --------------------
> linux:~ # mke2fs -n /dev/sda2
> mke2fs 1.42.4 (12-June-2012)
> Filesystem label=
> OS type: Linux
> Block size=4096 (log=2)

>
> linux:~ #
> --------------------

Well, now you have destroyed whatever was in sda2.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

On 2013-03-04 10:56, jcdole wrote:

> I am testing REDO BACKUP to backup the system files without data.

What is “REDO BACKUP”, a product?

> I call data every things that belong to users ( root user, peter , paul
> and other ) including script and other things kept in ~/bin.
> So I want tro restore the system without restoring /home nor /root.
>
> As I said “as this could happens on a production system, using a live
> cd, is there a way to re-activate previous partitions without
> formatting them as during install.”
> Just I want to do is to recreate the lost partition without loosing
> data, the same way as when creating a new install and instruct the
> partition tools to create the home partition and the root user partition
> without formating them.

I’m sorry, I do not understand at all what you are trying to do. Maybe
somebody else understands and can explain.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

Not necessary.


**-n**
    Causes **mke2fs** to not actually create a filesystem, but  display what it would do if it were to create a filesystem.
    This can be  used to determine the location of the backup superblocks for a particular filesystem, so long  as the
    **mke2fs** parameters that were passed when the filesystem was originally created are used again. (With the **-n** option
    added, of course!) 

On 2013-03-04 14:26, arvidjaar wrote:
>
> robin_listas;2531800 Wrote:
>>
>>> linux:~ # mke2fs -n /dev/sda2
>>
>> Well, now you have destroyed whatever was in sda2.
>>
>
> Not necessary.
>
> Code:
> --------------------
>
> -n
> Causes mke2fs to not actually create a filesystem, but display what it would do if it were to create a filesystem.
> This can be used to determine the location of the backup superblocks for a particular filesystem, so long as the
> mke2fs parameters that were passed when the filesystem was originally created are used again. (With the -n option
> added, of course!)
> --------------------

Ah, right… But then I’m lost about the problem. I need a better
description. Language barrier? :-?


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

Same here. For example, it eludes me completely why one wants to post what an mk2fs would do when the last thing you probably want to do is destroying what is on that file system. :question:

Also, as Carlos asked earlier, an explanation about what “REDO BACKUP” is, might be very usefull (to say it politely).

If all that was damaged is the partition boundaries and the data is untouched/still intact,

IIRC a short while ago I ran Testdisk which found my original setup and restored the partitions as before in a couple seconds without issue.
TestDisk - CGSecurity

As always, when confronted with a problem particularly dealing with a very basic sub-system, it’s best to sit back a moment and gather your thoughts. It’s <vey> important not to do anything rash that could exponentially make the problem worse, maybe irrecoverable.

And, it’s a particularly good idea if you aren’t “expert” to do an <disk image> backup so that you make a copy of <everything> on the disk, not just what’s running properly.

HTH,
TSU

tsu2 tell you what I am thinking about.

For a complete answer you can see :Redo Backup Bare Metal Restore Solution GUI Backup Open Source GPL Recovery I can’t say best.
As a professional you should know this tools. Don’t you.

My question was :
Is it possible to restore a partition without reformat it.

Of course as said by tsu2, it is suppose that If all that was damaged is the partition boundaries and the data is untouched/still intact,

Please see what tsu2 had said. This is what I was meaning.

I never heard about this probleme. Could you give me a link for my information. It would be kind.

Well, maybe it is not ext4. Try to find out what it is via

It is ext4

I doubt. I used many professional tools on HP-UX, Solaris and the like. I do not think I should know all that is available on the market. And my idea is that an OP should explain how he makes backups and what tools he uses, providing the nesseccary links so others can try to understand…

In any case, I do not understand very much about what is going on here and wjsh all of you the best with finding a solution.

Hi all,

a question:

jcdole, in your 1st posting you wrote

I never had a /dev/sda1.

OK I usually dual-boot with windows, maybe that’s the reason.

OK, let’s assume you don’t dual-boot with windows.

Then /dev/sda1 could at most be a partition, but not a partition table.

So, restoring a single partition (/dev/sda1) will of course not restore the information needed to access other partitions,
like - in your case - /dev/sda2 and /dev/sda3 .

To get these back again (as long as they haven’t been overwritten or partially overwritten),
you’ll need a backup of the MBR of the HDD (Hard Disk Drive) they’re on,
or otherwise of the GPT on that drive, in the case that you have a recent systems with a BIOS
supporting GPT (or GUID Partition Table) for your HDD.

But if these partitions would still exist, then you should at least be able to see them after booting from a live CD.

Yes, in general this should be possible, if the partition is still existing as such.

And further, if the partition still exists, then it should be able to detect it using the live CD.

At least that’s what I know after all my experience.

Good luck
Mike

On 2013-03-04 21:16, jcdole wrote:
>
> robin_listas;2531800 Wrote:
>> On 2013-03-04 10:46,
>> Why are you using /root as a mount point? That will destroy your
>> session.
>
> I never heard about this probleme. Could you give me a link for my
> information. It would be kind.

If you mount a partition at “/root”, all the contents of the current
sessions as root user (terminals where you did “su -”) disappear from
your system. Writes will go to the new “/root”, your partition that you
want to recover and that is so precious.

This is common and obvious Linux knowledge.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

On 2013-03-04 21:06, jcdole wrote:

> hcvv;2531838 Wrote:
>> Also, as Carlos asked earlier, an explanation about what “REDO BACKUP”
>> is, might be very usefull (to say it politely).
> For a complete answer you can see :‘Redo Backup Bare Metal Restore
> Solution GUI Backup Open Source GPL Recovery’ (http://redobackup.org/) I
> can’t say best.
> As a professional you should know this tools. Don’t you.

Not at all. We don’t have to know all the tools in existence.

Their link is just publicity. The wikipedia article says very little
about that tool, and that doesn’t explain at all what you may have done.
Maybe you have to go to a support forum of that product and ask them for
assistance.

I don’t understand at all your description of the problem nor can I
guess what you may have done… I can not help.


Cheers / Saludos,

Carlos E. R.
(from 11.4, with Evergreen, x86_64 “Celadon” (Minas Tirith))

1°) I am not using dualboot on this computeur.
2°) When I was speaking about sda1, I was speaking about /dev/sda1. I never spoke about a partition table. If somebody thinks so, I suppose I was not clear enough because english is not my mother language.
3°) you said

So, restoring a single partition (/dev/sda1) will of course not restore the information needed to access other partitions,
like - in your case - /dev/sda2 and /dev/sda3 .

What I was meaning, that it seems to me that as far I can tell :

before the restore operation, the yast2 partition tools shows all informations about all the partitions (sda1, sda2, sda3, extended partition, sda5, sda6,sda7) on the first sata disk.
after the restore operation, the yast2 partition tools shows only the partition size for sda2, sda3 ( no fs type, no label )

Later, in the last thread, I indicate how I solved part of the problem.