Modify the linux system of a workstation in multi-boot ?


  • Hello,

    I would like to know if it is possible to modify only the Linux partition of a multiboot computer (with windows).
    I have this computer (not yet inventoried in FOG):

    777-529-max.png

    and I would like to replace the sda5 partition by the Ubuntu Mate 20.04 image that I deployed in another classroom which is single disk resizable?

    How do I go about it? Is there a tutorial?

    Thanks a lot!


  • @sebastian-roth Yeahh, it works ! Thanks again !

  • Moderator

    @Bristow-0 Well, do you want to capture the full disk (all partitions) again, then you need to set the image to UbuntuMate2004. Though if you only want to capture that single partition then stick with image PartLinuxSda5.

    Is machine DB420-P01 really the one you want to capture from?

    As you manually created that new image directory and copied the file over the access rights are set differently and that is probably causing the “Datebase Update” error. Run chmod -R 777 /images/PartLinuxSda5 and you should be able to capture to that image - overwrite it.


  • @sebastian-roth First of all, I thank you once again for helping me solve my problems.

    I confirm that the code is identical to the GitHub.

    Here are the contents of the image folder

    $ ls -al /images/UbuntuMate2004/
    total 6204524
    drwxrwxrwx  2 root       root       4096 juil.  1  2021 .
    drwxrwxrwx 14 fogproject root       4096 déc.   2 08:36 ..
    -rwxrwxrwx  1 root       root          4 juil.  1  2021 d1.fixed_size_partitions
    -rwxrwxrwx  1 root       root          0 juil.  1  2021 d1.has_grub
    -rwxrwxrwx  1 root       root    1048576 juil.  1  2021 d1.mbr
    -rwxrwxrwx  1 root       root        268 juil.  1  2021 d1.minimum.partitions
    -rwxrwxrwx  1 root       root         16 juil.  1  2021 d1.original.fstypes
    -rwxrwxrwx  1 root       root         39 juil.  1  2021 d1.original.swapuuids
    -rwxrwxrwx  1 root       root    2549735 juil.  1  2021 d1p1.img
    -rwxrwxrwx  1 root       root 6349798077 juil.  1  2021 d1p2.img
    -rwxrwxrwx  1 root       root        268 juil.  1  2021 d1.partitions
    
    

    and the first directory :

    $ ls -al /images/PartLinuxSda5/
    total 6200988
    drwxr-xr-x  2 root       root       4096 déc.   3 11:42 .
    drwxrwxrwx 14 fogproject root       4096 déc.   2 08:36 ..
    -rwxr-xr-x  1 root       root 6349798077 déc.   3 11:42 d1p5.img
    

    I’m not sure, but shouldn’t I put the post I’m capturing on my Ubuntu 2004 Image?
    Currently, I have this :

    f310dea5-b0af-4217-8c8e-dc9516775004-image.png

    Thanks for your help !

  • Moderator

    @Bristow-0 Hmmm, don’t think I’ve seen a memory exhaustion at this part of the code yet. Please take a look at the php file mentioned in the log message. Does it look exactly like the original code here on github?

    If so, then we’d need to do some further investigation on why this fails on your system. Please run ls -al /images/UbuntuMate2004/ on your FOG server and post output here. Change the directory name to the name of what you currently use. I am not sure if it’s still the same image name/path or if you chose a different one.


  • I found in apache2 log :

    [Mon Jan 03 10:54:34.631953 2022] [proxy_fcgi:error] [pid 9034] [client 172.17.14.41:40394] AH01071: Got error 'PHP message: PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 20480 bytes) in /var/www/fog/lib/fog/fogftp.class.php on line 953'
    

    I didn’t find much to do in the forum… Any idea ?

    Fog 1.5.9

    Thanks

  • Moderator

    @bristow-0 said in Modify the linux system of a workstation in multi-boot ?:

    It works with set the image type to “Single Disk - no resizable”, but, i can’t captured because updating database failed

    This error has nothing to do with the image type used as far as I know from the top of my head. Please take a look at the Apache and PHP-FPM logs to see what error it tells us. See my signature on where to find those logs.


  • It works with set the image type to “Single Disk - no resizable”, but, i can’t captured because updating database failed 😞

    IMG_20211217_133613.resized.jpg

    I don’t know why because my server works fine.

  • Moderator

    @Bristow-0 Please set the image type to “Single Disk - non-resizable” and try again.


  • What is surprising is that I want to capture only the sda5 partition since I am using the same image that I have defined according to the message you sent me: https://forums.fogproject.org/post/146165

    I’m going to try to fix it with a live usb, I hope it will be enough!

  • Moderator

    @bristow-0 said in Modify the linux system of a workstation in multi-boot ?:

    Why does Fog check this sda2 file system? And how can I get away with my capture?

    Well if you want FOG to shrink your partition layout it needs to do some basic checks and this fails here obviously.

    You might want to to the filesystem check manually before capturing to see if that fixes the issue. For that you boot some kind of live OS and run e2fsck /dev/sda2

    Hmmmmm, if you really only want to capture sda5 and don’t care about the rest, then I suggest you create a new image definition for that, set Partition to “Partition 5 only” and do the capture.


  • Thanks @Sebastian-Roth it worked!

    On the other hand, as you expected, I had to boot via the live usb grub-repair, then I ran the 2 commands

    grub-install /dev/sda
    

    then

    update-grub
    

    I also modified the /etc/fstab which was not correct anymore…

    On the other hand, I have another problem that I can’t solve. I made some updates on my system (sda5 partition) and I want to capture it again to deploy it. Why do I get this error, knowing that it is an old linux system on the workstation:

    fog1.jpg

    Why does Fog check this sda2 file system? And how can I get away with my capture?

    Thanks a lot for your help!

  • Moderator

    @bristow-0 said in Modify the linux system of a workstation in multi-boot ?:

    I guess I have to copy the d1p2.img file? What about the other files, I don’t need them?

    Yes in this case you would copy d1p2.img but name it d1p5.img in the new image directory (so it will be deployed to the correct partition on the new systems). No other files needed because you only deploy that single partition.

    Be aware it’s very likely the bootloader won’t play nicely without more work on this but give it a try.


  • Thanks a lot @Sebastian-Roth for your quick response !

    One last question in link before I test…

    The partitioning scheme of my UbuntuMate20.04 image to copy is this one:

    -dev-sda - GParted (au nom du superutilisateur)_037.png

    Files in my image directory :

    Sélection_036.png

    I guess I have to copy the d1p2.img file? What about the other files, I don’t need them?

    Thanks !

  • Moderator

    @Bristow-0 Capturing and deploying a single partition is easy. I suggest you create new image definition, make sure you set the option Partition to “Partition 5 only”! As Image Type use Single Disk - resizable or non-resizable should both work (this plays much more a role when Partition is set to “Everything” which you don’t want in this case!).

    Now go to the command line of your FOG server, manually create the new image directory as /images/newimagename (or whatever it was named) and copy the partition image file you want to use over: cp /images/existingimagewithlinuxpartition/d1p5.img /images/newimagename.

    With that in place you should be able to deploy to your machines.

    BUT there is something I am concerned with and that’s the question of what boot loader do you use and which partition was it installed into??? I can imagine you can’t boot the Linux OS after deploying it the way I described but I am pretty sure this can be fixed using postinstall script magic. So you need to figure out which bootloader is used and where it was installed.

328
Online

9.1k
Users

15.7k
Topics

145.8k
Posts