Michael wrote:
On Saturday, 15 March 2025 07:29:32 Greenwich Mean Time Dale wrote:
Howdy,

I have a Samsung SSD 500GB drive that I ended up not using in my new
build, went with the m.2 stick thingy.  I decided that I would put it in
the NAS box and replace the spinning rust drive.  I booted a sysrescue
image.  I created and mounted both drives, creating directories as
needed.  I then one at a time used cp -av to copy /bin, /boot and so on
skipping /dev, /proc and such that is created on the fly so to speak.  I
did create /sys and /proc tho.  I even copied the home directory, not
that there is much in there that I need.  Once I got it all copied, I
chrooted into the new drive.
The Handbook states you should -rbind the /dev of the host before you chroot.  
Did you do this?

Yes, I did.  I have a text file in my root directory for things like mounting other OSs that I plan to chroot into, how to run grub and such.  This is how I mounted things, excluding the root and boot file system. 


mount -t proc proc /mnt/gentoo/proc
mount --rbind /dev /mnt/gentoo/dev
mount --rbind /sys /mnt/gentoo/sys
cp -L /etc/resolv.conf /mnt/gentoo/etc/
chroot /mnt/gentoo /bin/bash
source /etc/profile


I also ran env-update, just in case.  I need to add that to the file.  ;-)




I installed grub on it using grub-install
/dev/sdb, since it is the second drive at this point.
Did you check if 'ls -l /dev/disk/by-id' within the chroot was mapping the 
correct disk to /dev/sdb?

I'll assume your NAS is a legacy BIOS not an EFI MoBo and grub-install /dev/
sdb did not throw up any errors.


Yes, it is the old BIOS type setup.  EFI I don't think was a thing back when it was made.  Poor old mobo.  I did out of habit put a GPT partition table on the SSD tho.  I should have used the old DOS partition table thingy.  My bad.  I dug out the parted command to make it so it will work and it has worked in the past. 



        
I went back and
looked at the install docs to be sure I didn't need to run anything
else.  Since I already had a config file and all, it should just work. 

When I try to boot with the SSD drive, I get this on the screen, pardon
my having to type it in.  This comes up right after the BIOS screen.


loading operating system . . .
GRUB


That's it.  It can't be the BIOS because if I connect the old drive as
first drive, it boots just fine.  I've missed a command somewhere.  I'm
sure it isn't the OS itself since it is a clone basically.  I am almost
certain I missed a grub command somewhere but can't figure out what it
is.  Searching for the error got other hits but not what I'm seeing. 
You did not mention if you ran 'grub-mkconfig -o /boot/grub/grub.cfg' within 
the chroot.  This would read UUID and PARTUID of the new disk and its / 
partition and add these to your grub.cfg file.  Unless you used dd to clone 
the partitions from the old to the new, the new disk partitions and fs IDs 
will be different to the old disk.


I did run that.  I wasn't sure if I needed to or not but I did anyway.  It's one of the commands in my little grub text file, for when I can't remember how to do things, exactly. 


        
Has someone seen this before and recall how to fix it?  Remember what
command it is that I missed? 
I think if you follow the Handbook to chroot into your new drive and update 
your grub.cfg it /should/ work.  While you're at it don't forget to edit your 
fstab, if you are specifying filesystems in it using UUIDs.

It's been stormy here.  My NAS box is connected to a UPS but I still try not to run it when there is a chance of power failure.  In between the storms, I booted into the original OS then mounted and chrooted into the SSD OS.  I updated the fstab file, I forgot to do that before.  It wasn't even right since I went from a DOS partition table to a GPT one.  The numbers changed.  Anyway.  I ran all the grub commands and such and when I tried to boot it with only the SSD drive connected, same screen.  No boot.  Grub isn't happy about something.



I'm not sure this SSD drive is going to make that old NAS mobo go any
faster.  LOL  It is kinda old. 
I have found SSDs even when installed on old SATA 2.0 MoBos give a performance 
boost - but it depends how slow the spinning disk was.  Replacing a 10,000RPM 
disk with an SSD would not provide any celebratory performance difference.

PS. Check the MoBo BIOS is set to use AHCI for the SATA port you're connecting 
this SSD on, or TRIM/discard won't work.

The biggest thing that slows that system is that the CPU doesn't have AES support for my encryption on the drives.  Still, I wanted to play with it and see if it would go any faster.  I kinda hate having a nice SSD drive laying on the shelf doing nothing.  I got a good deal but still, needs to get some exercise. 

I know I'm missing a step somewhere.  What I may do, start over and put a DOS partition table on it and just copy over /etc and the world file.  Then let it rebuild everything.  If I do that, I got to wait until this storm is gone and may have to wait until we finish that last tree.  We got one finished yesterday and got the last one cut up and ready to split, haul to the barn and stack.  It's a LOT of wood.  He said it will last him two years at least.  He keeps 3 to 5 years worth on hand.  I think he is at about the 6 year mark now.  He loves working with wood.  Oh, trees were dead or dying for those who hate to read about wood being cut up.  The two we cut was a danger to the guys home and outbuildings, depending on where the wind took it.  The first tree was dead.  It had no leaves last year and was rotting at the bottom.  The two trees had insect damage and were starting to die as well.  When it fell, the trunk actually broke in a couple places since it was weakening.  Most of the trees he cuts, storms put them on the ground.  Cutting down a tree isn't something he does a whole lot of unless a tree is dead.

Anyway, I may just do a quick reinstall and change partition tables.  Maybe that has something to do with it.  One reason I'd like to figure it out tho, may help some other poor soul who is trying to use some older hardware and runs into this problem. 

Dale

:-)  :-)