Boot flag not set

Bug #200680 reported by fog
4
Affects Status Importance Assigned to Milestone
partimage-ng
In Progress
Undecided
Dmitry Ivanov

Bug Description

After pushing an image back down the bootable flag is not set. Here is our test case:

2 Parts:

Partition 1
Fat16
no bootable

Partition 2
NTFS
bootable

After imaging it back down, neither have the bootable flag set.

We would really like to have this feature added, we would like to implement this as part of FOG:

http://sourceforge.net/projects/freeghost

Thanks again and we will be happy to provide any additional information

Dmitry Ivanov (vonami)
Changed in partimage-ng:
assignee: nobody → vonami
milestone: none → 0.1
status: New → In Progress
Revision history for this message
Dmitry Ivanov (vonami) wrote :

I completely forgot about partition attributes like bootable flag, hidden flag etc. Thanks for testing it. I'll try to fix this ASAP.
The main problem is that partimage-ng supports various partition table types (not only dos-like) each having its own attribute set for partitions.
I need to find a common denominator for all of them.

I'm happy to hear you are considering including partimage-ng into FOG. Hopefully this will help test partimage-ng more widely.
Feel free to ask me about features you need from partimage-ng to use it in FOG.

Revision history for this message
Damiano Venturin (damko) wrote :

I Dmitry

first I want to thank you for your great job. go on in this way, your work is precious

I want to show you a situation

this is the partition table of a common HP computer

x3400:/mnt/dev/sdd2/PRELOAD# sfdisk -l /dev/sdc

Disk /dev/sdc: 60801 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End #cyls #blocks Id System
/dev/sdc1 * 0+ 6528 6529- 52444161 7 HPFS/NTFS
                end: (c,h,s) expected (1023,254,63) found (1022,254,63)
/dev/sdc2 0 - 0 0 0 Empty
/dev/sdc3 59515 60800 1286 10329795 7 HPFS/NTFS
/dev/sdc4 0 - 0 0 0 Empty

as you can see sdc2 is empty

if I backup and restore the full disk I obtain this partition table

x3400:/mnt/dev/sdd2/PRELOAD# sfdisk -l /dev/sdd

Disk /dev/sdd: 121601 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start End #cyls #blocks Id System
/dev/sdd1 * 0+ 6528 6529- 52444161 7 HPFS/NTFS
/dev/sdd2 59515 60800 1286 10329795 7 HPFS/NTFS
/dev/sdd3 0 - 0 0 0 Empty
/dev/sdd4 0 - 0 0 0 Empty

cheers
Dam

http://dventurin.wordpress.com

Revision history for this message
Dmitry Ivanov (vonami) wrote :

Hi!

> first I want to thank you for your great job. go on in this way, your work is precious

Thanks!

> if I backup and restore the full disk I obtain this partition table
> x3400:/mnt/dev/sdd2/PRELOAD# sfdisk -l /dev/sdd
> Disk /dev/sdd: 121601 cylinders, 255 heads, 63 sectors/track
> Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
> Device Boot Start End #cyls #blocks Id System
> /dev/sdd1 * 0+ 6528 6529- 52444161 7 HPFS/NTFS
> /dev/sdd2 59515 60800 1286 10329795 7 HPFS/NTFS
> /dev/sdd3 0 - 0 0 0 Empty
> /dev/sdd4 0 - 0 0 0 Empty

Actually, partimage-ng didn't do anything harmful. And I see no point
in having a hole in the partition table.

partimage-ng does *not* create a snapshot of the partition table. Instead
it saves info about the location of partitions and their geometry and
recreates them when restoring the whole disk. That's why it hasn't
created an empty partition table entry.

What software have you used to create such a partition layout?
Or did the system come preloaded by manufacturer?

The question is, does this issue cause problems for you?
I suppose everything works fine except you don't have this hole
any longer, right?

Revision history for this message
Damiano Venturin (damko) wrote :

you are right, there is no sense in having a hole. But it's the Hp way. That is the HP partition schema of a common HP disk just out of the box. The "hole" was there after restoring, so no problem with geometry, but the second partition was called /dev/sdd2 and not /dev/sdd3 as it should be. The "hole" is very important because, booting the pc and after "HP wizard configuration", the first partition is resized to cover all the hole.

I didn't test the disk after the full restore. Anyway I have a simple and well-known trick to save and restore the partition table:

to save:
sfdisk -d /dev/sdX > partition_table

to restore:
sfdisk --force /dev/sdX < partition_table

fast and easy

After restoring using partimage-ng, I did the partition restore (it fixs also the bootable flag) and everything worked perfectly

Revision history for this message
Dmitry Ivanov (vonami) wrote :

Hi Damiano,

I just looked into your issue. I couldn't talk libparted (the library I'm using to manage partition tables) into creating a hole in the partition table (ie an empty entry). So I'm going to fix it the hackish way (save/restore the whole sector with the partition table when a hole is detected). I'm not happy with it but I don't see another way to deal with such bad-formed disk layouts.

Revision history for this message
Damiano Venturin (damko) wrote : Re: [Bug 200680] Re: Boot flag not set

Dmitry Ivanov wrote:
> Hi Damiano,
>
> I just looked into your issue. I couldn't talk libparted (the library
> I'm using to manage partition tables) into creating a hole in the
> partition table (ie an empty entry). So I'm going to fix it the hackish
> way (save/restore the whole sector with the partition table when a hole
> is detected). I'm not happy with it but I don't see another way to deal
> with such bad-formed disk layouts.
>
Hi Dmitry,
thanks for your reply. Unfortunatly my experience with c++ is just
school level and probably completly forgotten now and so I can't be
usefull. But, what do you think about a simple
sfdik -d /dev/sdXY > part_file (to save)
and a
sfdisk /dev/sdXY < part_file (to restore)
?
it works great

cheers

Dam

Revision history for this message
Dmitry Ivanov (vonami) wrote :

Good news! I finally found time to fix this nasty bug. Sorry for the long delay, these days I'm extremely busy with other things. So, partition flags are now properly saved/restored (devel@r115).

Damiano, your bug has to wait another week to get fixed. Sorry.

Revision history for this message
Damiano Venturin (damko) wrote :

Hi Dmitry

I don't see my "bug" as a real bug. I can't demand you anything .. You are doing a very good work and thank you very much for this.

May be this in not the best place for this but I want to show what i did thanks to your software and smak http://www.squadrainformatica.com/smak/ [my php framework]

Revision history for this message
Damiano Venturin (damko) wrote : and this is the result
Revision history for this message
Dmitry Ivanov (vonami) wrote :

Hi Damiano,

this is cool!

Are you using this product to backup/restore customers' systems? Over the network?
Can it be used to roll images to a set of systems at once via multicasting (udpcast)?

Revision history for this message
Damiano Venturin (damko) wrote :

right now it's in pre-alpha test, so not used in production. This is due to 2 reasons:
- as you can see in the project page I'm trying to merge it with drupal. so no sense to go on until this step is not completed. Anyway what you see in the screenshot works
- the application is too young to be used in production environment

I didn't think to expand the application with network support. We do not work on few large network but on a lot of single different machines. So we generally physically unmount the drive and connect it to a "special" workstation on which brs (the application in the screenshot) runs. Backup and roll backup work.

I used a php interface just because our ERP is php based and in this way I can merge the application directly into the ERP. This is better for technicians and much better for quality procedures, because I can track and see in real time what's happening in the laboratory.

Beside this I think that network support could be done easily just modifying a knoppix distro or something like that and running a modified version of brs (as client) on it and a modified version of brs on server side. Anyway this need a bit of time to think the better solution. Are you interested in that?

Revision history for this message
Dmitry Ivanov (vonami) wrote :

Hi Damiano!

Sorry for the delay, but I almost have no time (being a SoC student sucks up a lot of time).
Not an excuse really, but I sometimes just forget that I have to reply somewhere :)

Yes, I'm interested in your work and am eager to try out this interface. Also, it might be
similar to what the FOG guys are doing.

We may move this discussion to the partimage-ng's forums, this is not an appropriate place
to talk, this is a bug report after all :)

Revision history for this message
Damiano Venturin (damko) wrote : Re: [Bug 200680] Re: Boot flag not set

Dmitry Ivanov wrote:
> Hi Damiano!
>
> Sorry for the delay, but I almost have no time (being a SoC student sucks up a lot of time).
> Not an excuse really, but I sometimes just forget that I have to reply somewhere :)
>
> Yes, I'm interested in your work and am eager to try out this interface. Also, it might be
> similar to what the FOG guys are doing.
>
> We may move this discussion to the partimage-ng's forums, this is not an appropriate place
> to talk, this is a bug report after all :)
>
>
Hi Dmitry!
yes you are right. it's a forum matter :-) I'll reply there one of the
next days (have some news and a small surprise)

Cu!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.