LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   booting a linux os hard drive in another box? (https://www.linuxquestions.org/questions/linux-hardware-18/booting-a-linux-os-hard-drive-in-another-box-4175658646/)

sirius57 08-05-2019 09:12 PM

booting a linux os hard drive in another box?
 
I wondered if it was possible to boot a linux os hard drive taken from one box and placed in another box, so I tried it. The grub menu loaded, then the linux os started booting and then stopped in mid stream. I know I could slave the drive, but I wanted to boot it. Is the drive hardware specific to the box it came from?

wagscat123 08-05-2019 09:17 PM

What's the error message when your computer boots up? I see a bunch of openSUSE distros in your profile; hit F2 or Escape before the system stalls to see the boot messages. I've done this before; once in a while you might have to reconfigure hardware changes that weren't automatically detected. There might be some issues in fstab, I don't know for sure if UUIDs stay from one computer to another, I'd guess that they do.

rnturn 08-05-2019 10:09 PM

Quote:

Originally Posted by sirius57 (Post 6021938)
I wondered if it was possible to boot a linux os hard drive taken from one box and placed in another box, so I tried it. The grub menu loaded, then the linux os started booting and then stopped in mid stream. I know I could slave the drive, but I wanted to boot it. Is the drive hardware specific to the box it came from?

Are you able to edit the boot command line in grub? If so, add "single" to the end and press F10. The system should partially boot. If there are any errors you should be able to correct them while in single user mode. If not, you'll need to boot from installation media in rescue mode and make changes after you've mounted the disk's root filesystem.

As wagscat123 mentioned, the boot problem could be related to something odd in "/etc/fstab". I tend to prefer labeling filesystems using "tune2fs" and adjusting "/etc/fstab" to mount using "LABEL=fileystem-label" instead of "UUID=...". (I've never done this on the UEFI boot partition, though.) I've had to comment out large portions of "/etc/fstab" after major upgrades to sort out mounting problems one filesystem at a time followed by "mount -a".

BTW, it'd be easier to help if we could see the exact error message you've encountering. I know it's tough to get these before the system is fully operational and you may need to write things down and re-type them. But without any hints, we're all sort of feeling around in the dark.


Cheers...

ondoho 08-06-2019 04:07 AM

Ho-hum.
We had an identical question just a few months ago; I guess they pop up every now and then.
The obvious question in your case is: where and how exactly did it stop "midstream"? More information required...
And: did you do any preparation before attempting the boot? AFAIR this is perfectly possible, but UUIDS might need to be adjusted in /etc/fstab.

zeebra 08-06-2019 01:28 PM

Quote:

Originally Posted by sirius57 (Post 6021938)
I wondered if it was possible to boot a linux os hard drive taken from one box and placed in another box, so I tried it. The grub menu loaded, then the linux os started booting and then stopped in mid stream. I know I could slave the drive, but I wanted to boot it. Is the drive hardware specific to the box it came from?

It is possible provided the GRUB is correctly configured and provided the Kernel on the disk support the hardware that you have on your new computer. If your Kernel is a huge/generic Kernel, it will most likely support all the hardware on your new computer, so it should work. This is unless the Kernel is very old and the new computer has very new hardware.

Since the Kernel will most likely boot your hardware, the main issue is getting Grub to boot correctly. You can experiment with this with the "e" option to edit your Grub options when you boot.

zeebra 08-06-2019 01:32 PM

Quote:

Originally Posted by rnturn (Post 6021947)
Are you able to edit the boot command line in grub? If so, add "single" to the end and press F10.

This is a good idea, but instead of adding "single" you could just add "1" which will boot into single user mode on any init system, and 1 is shorther than single :eek:

AlienBison 06-11-2020 01:55 AM

Quote:

Originally Posted by zeebra (Post 6022198)
It is possible provided the GRUB is correctly configured and provided the Kernel on the disk support the hardware that you have on your new computer. If your Kernel mcdvoice is a huge/generic Kernel, it will most likely support all the hardware on your new computer, so it should work. This is unless the Kernel is very old and the new computer has very new hardware.

Since the Kernel will most likely boot your hardware, the main issue is getting Grub to boot correctly. You can experiment with this with the "e" option to edit your Grub options when you boot.

Nice collection keep up the good work.


All times are GMT -5. The time now is 04:18 AM.