Replacing linux kernel from outside of system











up vote
0
down vote

favorite












There is a certain ubuntu image that works (from the SD card) with a hardware controller. The whole image takes 2 gigabytes, for such is the card size. The image is built on the old kernel. We need to replace the motherboard, because old one are no longer available, and new appropriate don't speak with old kernel. And most importantly, irrevocably (due to a certain chaos when changing developers) the root password from the image is lost - that is, replacing the kernel in a civilized manner, from the inside, alas, will not work. The question: is it possible - and how can I- change the kernel, without changing the rest, outside the system, simply by rewriting something the card with existing image from my laptop? If not, it will be necessary to rebuild the entire streamlined and debugged image, which I would like to avoid.










share|improve this question


























    up vote
    0
    down vote

    favorite












    There is a certain ubuntu image that works (from the SD card) with a hardware controller. The whole image takes 2 gigabytes, for such is the card size. The image is built on the old kernel. We need to replace the motherboard, because old one are no longer available, and new appropriate don't speak with old kernel. And most importantly, irrevocably (due to a certain chaos when changing developers) the root password from the image is lost - that is, replacing the kernel in a civilized manner, from the inside, alas, will not work. The question: is it possible - and how can I- change the kernel, without changing the rest, outside the system, simply by rewriting something the card with existing image from my laptop? If not, it will be necessary to rebuild the entire streamlined and debugged image, which I would like to avoid.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      There is a certain ubuntu image that works (from the SD card) with a hardware controller. The whole image takes 2 gigabytes, for such is the card size. The image is built on the old kernel. We need to replace the motherboard, because old one are no longer available, and new appropriate don't speak with old kernel. And most importantly, irrevocably (due to a certain chaos when changing developers) the root password from the image is lost - that is, replacing the kernel in a civilized manner, from the inside, alas, will not work. The question: is it possible - and how can I- change the kernel, without changing the rest, outside the system, simply by rewriting something the card with existing image from my laptop? If not, it will be necessary to rebuild the entire streamlined and debugged image, which I would like to avoid.










      share|improve this question













      There is a certain ubuntu image that works (from the SD card) with a hardware controller. The whole image takes 2 gigabytes, for such is the card size. The image is built on the old kernel. We need to replace the motherboard, because old one are no longer available, and new appropriate don't speak with old kernel. And most importantly, irrevocably (due to a certain chaos when changing developers) the root password from the image is lost - that is, replacing the kernel in a civilized manner, from the inside, alas, will not work. The question: is it possible - and how can I- change the kernel, without changing the rest, outside the system, simply by rewriting something the card with existing image from my laptop? If not, it will be necessary to rebuild the entire streamlined and debugged image, which I would like to avoid.







      linux linux-kernel






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 28 at 10:50









      zimopisec

      1




      1






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          First, I can not stress enough not to use your working copy, but to make a backup copy and use that incase something goes horribly wrong.



          This may not work, but its your best shot.



          The kernel is dependent on the files in /boot to start with.



          System.map-4.19.1-1-default
          .vmlinuz-4.19.4-1-default.hmac
          config-4.19.4-1-default
          initrd-4.19.1-1-default
          initrd is symlinked to above
          symvers-4.19.1-1-default.gz
          sysctl.conf-4.19.1-1-default
          vmlinux-4.19.1-1-default.gz
          vmlinuz symlink to below
          vmlinuz-4.19.4-1-default


          You need all of these files in from the new version present, obviously most of the files names contain the version number and will be different depending on the kernel version you are using.



          Inside /lib/modules/ is a series of folder one for each kernel version.
          For example:



          4.19.4-1-default


          All the modules in this folder would be needed to be copied over.



          Finally your grub or grub2 files will need to be modified to point to this new files.




          1. Backup your SD card and use the backup copy

          2. If your old motherboard is non UEFI disable it on the new motherboard, or there will be issues.

          3. Get another SD card/hdd

          4. Install a newer version of whatever distro you were using.

          5. Copy /boot and /lib/modules/ to the appropriate places on the backup copy of your OS. If present /usr/lib/bootloader also should be copied over.

          6. Boot and see what happens.


          There will probably be further compatibility issues. The biggest danger is moving to far forward and transitioning from initd to systemd or other major change.



          I would suggest finding out what version of the distro you were using and move only 1 version higher to start with. If installation fails you can move forward one version at a time.



          When you have a bootable system, then I suggest using apt-get or etc to do a full distro upgrade in the proper manor.






          share|improve this answer























          • Thanks. It is not work immediately, but gives me important info
            – zimopisec
            Dec 2 at 11:45











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1379046%2freplacing-linux-kernel-from-outside-of-system%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          First, I can not stress enough not to use your working copy, but to make a backup copy and use that incase something goes horribly wrong.



          This may not work, but its your best shot.



          The kernel is dependent on the files in /boot to start with.



          System.map-4.19.1-1-default
          .vmlinuz-4.19.4-1-default.hmac
          config-4.19.4-1-default
          initrd-4.19.1-1-default
          initrd is symlinked to above
          symvers-4.19.1-1-default.gz
          sysctl.conf-4.19.1-1-default
          vmlinux-4.19.1-1-default.gz
          vmlinuz symlink to below
          vmlinuz-4.19.4-1-default


          You need all of these files in from the new version present, obviously most of the files names contain the version number and will be different depending on the kernel version you are using.



          Inside /lib/modules/ is a series of folder one for each kernel version.
          For example:



          4.19.4-1-default


          All the modules in this folder would be needed to be copied over.



          Finally your grub or grub2 files will need to be modified to point to this new files.




          1. Backup your SD card and use the backup copy

          2. If your old motherboard is non UEFI disable it on the new motherboard, or there will be issues.

          3. Get another SD card/hdd

          4. Install a newer version of whatever distro you were using.

          5. Copy /boot and /lib/modules/ to the appropriate places on the backup copy of your OS. If present /usr/lib/bootloader also should be copied over.

          6. Boot and see what happens.


          There will probably be further compatibility issues. The biggest danger is moving to far forward and transitioning from initd to systemd or other major change.



          I would suggest finding out what version of the distro you were using and move only 1 version higher to start with. If installation fails you can move forward one version at a time.



          When you have a bootable system, then I suggest using apt-get or etc to do a full distro upgrade in the proper manor.






          share|improve this answer























          • Thanks. It is not work immediately, but gives me important info
            – zimopisec
            Dec 2 at 11:45















          up vote
          0
          down vote













          First, I can not stress enough not to use your working copy, but to make a backup copy and use that incase something goes horribly wrong.



          This may not work, but its your best shot.



          The kernel is dependent on the files in /boot to start with.



          System.map-4.19.1-1-default
          .vmlinuz-4.19.4-1-default.hmac
          config-4.19.4-1-default
          initrd-4.19.1-1-default
          initrd is symlinked to above
          symvers-4.19.1-1-default.gz
          sysctl.conf-4.19.1-1-default
          vmlinux-4.19.1-1-default.gz
          vmlinuz symlink to below
          vmlinuz-4.19.4-1-default


          You need all of these files in from the new version present, obviously most of the files names contain the version number and will be different depending on the kernel version you are using.



          Inside /lib/modules/ is a series of folder one for each kernel version.
          For example:



          4.19.4-1-default


          All the modules in this folder would be needed to be copied over.



          Finally your grub or grub2 files will need to be modified to point to this new files.




          1. Backup your SD card and use the backup copy

          2. If your old motherboard is non UEFI disable it on the new motherboard, or there will be issues.

          3. Get another SD card/hdd

          4. Install a newer version of whatever distro you were using.

          5. Copy /boot and /lib/modules/ to the appropriate places on the backup copy of your OS. If present /usr/lib/bootloader also should be copied over.

          6. Boot and see what happens.


          There will probably be further compatibility issues. The biggest danger is moving to far forward and transitioning from initd to systemd or other major change.



          I would suggest finding out what version of the distro you were using and move only 1 version higher to start with. If installation fails you can move forward one version at a time.



          When you have a bootable system, then I suggest using apt-get or etc to do a full distro upgrade in the proper manor.






          share|improve this answer























          • Thanks. It is not work immediately, but gives me important info
            – zimopisec
            Dec 2 at 11:45













          up vote
          0
          down vote










          up vote
          0
          down vote









          First, I can not stress enough not to use your working copy, but to make a backup copy and use that incase something goes horribly wrong.



          This may not work, but its your best shot.



          The kernel is dependent on the files in /boot to start with.



          System.map-4.19.1-1-default
          .vmlinuz-4.19.4-1-default.hmac
          config-4.19.4-1-default
          initrd-4.19.1-1-default
          initrd is symlinked to above
          symvers-4.19.1-1-default.gz
          sysctl.conf-4.19.1-1-default
          vmlinux-4.19.1-1-default.gz
          vmlinuz symlink to below
          vmlinuz-4.19.4-1-default


          You need all of these files in from the new version present, obviously most of the files names contain the version number and will be different depending on the kernel version you are using.



          Inside /lib/modules/ is a series of folder one for each kernel version.
          For example:



          4.19.4-1-default


          All the modules in this folder would be needed to be copied over.



          Finally your grub or grub2 files will need to be modified to point to this new files.




          1. Backup your SD card and use the backup copy

          2. If your old motherboard is non UEFI disable it on the new motherboard, or there will be issues.

          3. Get another SD card/hdd

          4. Install a newer version of whatever distro you were using.

          5. Copy /boot and /lib/modules/ to the appropriate places on the backup copy of your OS. If present /usr/lib/bootloader also should be copied over.

          6. Boot and see what happens.


          There will probably be further compatibility issues. The biggest danger is moving to far forward and transitioning from initd to systemd or other major change.



          I would suggest finding out what version of the distro you were using and move only 1 version higher to start with. If installation fails you can move forward one version at a time.



          When you have a bootable system, then I suggest using apt-get or etc to do a full distro upgrade in the proper manor.






          share|improve this answer














          First, I can not stress enough not to use your working copy, but to make a backup copy and use that incase something goes horribly wrong.



          This may not work, but its your best shot.



          The kernel is dependent on the files in /boot to start with.



          System.map-4.19.1-1-default
          .vmlinuz-4.19.4-1-default.hmac
          config-4.19.4-1-default
          initrd-4.19.1-1-default
          initrd is symlinked to above
          symvers-4.19.1-1-default.gz
          sysctl.conf-4.19.1-1-default
          vmlinux-4.19.1-1-default.gz
          vmlinuz symlink to below
          vmlinuz-4.19.4-1-default


          You need all of these files in from the new version present, obviously most of the files names contain the version number and will be different depending on the kernel version you are using.



          Inside /lib/modules/ is a series of folder one for each kernel version.
          For example:



          4.19.4-1-default


          All the modules in this folder would be needed to be copied over.



          Finally your grub or grub2 files will need to be modified to point to this new files.




          1. Backup your SD card and use the backup copy

          2. If your old motherboard is non UEFI disable it on the new motherboard, or there will be issues.

          3. Get another SD card/hdd

          4. Install a newer version of whatever distro you were using.

          5. Copy /boot and /lib/modules/ to the appropriate places on the backup copy of your OS. If present /usr/lib/bootloader also should be copied over.

          6. Boot and see what happens.


          There will probably be further compatibility issues. The biggest danger is moving to far forward and transitioning from initd to systemd or other major change.



          I would suggest finding out what version of the distro you were using and move only 1 version higher to start with. If installation fails you can move forward one version at a time.



          When you have a bootable system, then I suggest using apt-get or etc to do a full distro upgrade in the proper manor.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 28 at 17:23

























          answered Nov 28 at 17:12









          cybernard

          9,72131423




          9,72131423












          • Thanks. It is not work immediately, but gives me important info
            – zimopisec
            Dec 2 at 11:45


















          • Thanks. It is not work immediately, but gives me important info
            – zimopisec
            Dec 2 at 11:45
















          Thanks. It is not work immediately, but gives me important info
          – zimopisec
          Dec 2 at 11:45




          Thanks. It is not work immediately, but gives me important info
          – zimopisec
          Dec 2 at 11:45


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1379046%2freplacing-linux-kernel-from-outside-of-system%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Index of /

          Tribalistas

          Listed building