Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

boot system with m.2 ngff SSD connected with ngff-to-usb?

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
guyuming
Apprentice
Apprentice
Posts: 269
Joined: Thu Nov 19, 2020 1:09 am

boot system with m.2 ngff SSD connected with ngff-to-usb?

  • Quote

Post by guyuming » Tue Dec 19, 2023 6:19 am

The issue was originally posted here https://forums.gentoo.org/viewtopic-p-8 ... ml#8810017. Since now i think it may be more a kernel or driver issue, i rephrased the issue here:

I have an acer laptop, legacy BIOS, single SATA 75G HDD, with gentoo installed.

Recently, i bought a new SSD, m.2, ngff, 256G, and a ngff to usb cable, so that i can connect the SSD to laptop via USB.

I boot the laptop with a temperary usb drive(SLAX linux), the use dd command to clone the 75G HDD into new 256G SSD.

And i have a SATA to usb cable, i can connect the HDD with this cable to laptop and boot the system in this way. That is to say, i can boot the system with the HDD no matter its connected with SATA or via a SATA to usb cable.

But i cannot boot the system using the cloned SSD. If i boot with SSD connected to the laptop with USB, i got:

Code: Select all

error: invalid arch-independent ELF magic.
Entering rescue mode...
grub rescue>
If i boot with supergrub2 disk, enabing all native disk drivers in supergrub2, and then select the gentoo OS detected on SSD, i can see kernel loaded but stops with:

Code: Select all

Determining root device (trying UUID=94db66xxxxxx
Root device detected as /dev/sdb3!
Mounting /dev/sdb3 as root ...
Using mount -t ext4 -o ro /dev/sdb3 /newroot
!! init (/sbin/init) not found in mounted root device (/dev/sdb3)! 

so, what can be wrong? any kernel configuration i need for this new m.2 ngff 256G SSD connected via ngff to usb cable?
Last edited by guyuming on Thu Dec 21, 2023 1:22 am, edited 1 time in total.
Top
alexander-n8hgeg5e
n00b
n00b
Posts: 58
Joined: Sat Nov 02, 2019 2:47 pm

  • Quote

Post by alexander-n8hgeg5e » Tue Dec 19, 2023 12:01 pm

With supergrub2, It looks like you try to use the boot partition as root partition.
the kernel loads from the boot partition but then you need to tell grub where /init is
usually on the /root partition

Easiest would be to boot from the hdd and then install a full grub on the new disk, can be done without using "dd" again.
Top
guyuming
Apprentice
Apprentice
Posts: 269
Joined: Thu Nov 19, 2020 1:09 am

  • Quote

Post by guyuming » Thu Dec 21, 2023 1:21 am

@alexander-n8hgeg5e

but the message above says 'Mounting /dev/sdb3 as root ... '

and /dev/sdb3 is the root partition, not boot partition

in rescueshell, i can run ls and can see that /sbin/init is there.


I had suspected that the ngff ssd has something wrong and cannot be used as boot drive. However, if i clone SLAX linux ISO into the ngff ssd, i can boot with it.
Top
guyuming
Apprentice
Apprentice
Posts: 269
Joined: Thu Nov 19, 2020 1:09 am

  • Quote

Post by guyuming » Thu Dec 21, 2023 7:27 am

in rescueshell, a file /run/initramfs/gksosreport.txt is mentioned. I don't know how to copy this file out in rescueshell.

At the end of the file, around the error message i posted above, there is following error message:

Code: Select all

FAILED (1) : 'mountpoint -q /newroot/usr'
The /newroot is where /dev/sdb3, the root partition is mounted.

I was trying to cp the gksosreport.txt file into the /newroot directory, however, it said read-only file system
Top
pingtoo
Advocate
Advocate
User avatar
Posts: 2180
Joined: Fri Sep 10, 2021 8:37 pm
Location: Richmond Hill, Canada

  • Quote

Post by pingtoo » Thu Dec 21, 2023 3:53 pm

guyuming,

On /dev/sdb3, is there a file etc/initramfs.mounts?

If there is such file do you know why it exist?
Gentoo by default does not have this file unless you have essential directories (/usr, /var, etc...) in a separated file system. And you follow some instructions created this file.
!! init (/sbin/init) not found in mounted root device (/dev/sdb3)!
Is this file actually exist on /dev/sdb3's /sbin/init and the file permission is executable?
FAILED (1) : 'mountpoint -q /newroot/usr'
May be /dev/sdb3 is not the right root file system, this message may be indicate /bin/mountpoint file does not exist.
Top
guyuming
Apprentice
Apprentice
Posts: 269
Joined: Thu Nov 19, 2020 1:09 am

  • Quote

Post by guyuming » Fri Dec 22, 2023 5:56 am

It seems that there is something wrong with dd.

I just tried dcfldd, after first run of something like:

Code: Select all

dcfldd if=/dev/sda3 of=/dev/sdc3 hash=md5,sha1 hashlog=/root/hashlog.txt
and verify again with:

Code: Select all

dcfldd if=/dev/sda3 vf=/dev/sdc3 verifylog=/root/verifylog.txt
it says mismatch!

If there is anything wrong with the SATA to USB cable, why i can connect the original HDD to this cable and boot system with it?
Top
alexander-n8hgeg5e
n00b
n00b
Posts: 58
Joined: Sat Nov 02, 2019 2:47 pm

  • Quote

Post by alexander-n8hgeg5e » Fri Dec 29, 2023 8:00 am

The original hdd is already written, so this could be the reason,...
I don't know this dd command you are using but
it seems wrong that it can't be verified.
Is your disk mounted read only during the copy?
If you copy from a rw mounted disk then the filesystem
is likely to change the disk and then the verify fails.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56071
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Fri Dec 29, 2023 12:33 pm

guyuming,
I boot the laptop with a temperary usb drive(SLAX linux), the use dd command to clone the 75G HDD into new 256G SSD.
This makes the UUIDS, PARTUUIDs and so on *identical* between the the original and copy.
UUID means Universally Unique ...

That's safe only if both the original and clone are not connected to the same system at the same time as there is no way to tell them apart - They are clones.
Recently, i bought a new SSD, m.2, ngff, 256G, and a ngff to usb cable, so that i can connect the SSD to laptop via USB ... And i have a SATA to usb cable, i can connect the HDD with this cable to laptop and boot the system in this way. That is to say, i can boot the system with the HDD no matter its connected with SATA or via a SATA to usb cable.
Maybe. Mounting root from USB requires extra steps.
Normally root is mounted before USB is started. With root on USB, that can't happen.

You need a extra kernel parameter for root over USB.
Until it works, use rootdelay=30. Once it works change to rootwait.
The first will wait 30 seconds, then panic if root is not ready. The second will wail until root appears ... or forever. The panic message is useful.
The USB drivers required to to mount root must be built into the kernel to mount root over USB.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
guyuming
Apprentice
Apprentice
Posts: 269
Joined: Thu Nov 19, 2020 1:09 am

  • Quote

Post by guyuming » Fri Jan 05, 2024 5:22 am

Thanks all. It works now, although i still don't know why it failed before.

I just cloned it again this time succeed. because i had never used m.2 SSD to boot via USB before, i was not sure whether it can be done. I had cloned it more than once before and failed.
Top
Post Reply

9 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy