Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help with moving installation from HDD to SSD [SOLVED]
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 65

PostPosted: Sat Jan 27, 2024 12:17 pm    Post subject: Help with moving installation from HDD to SSD [SOLVED] Reply with quote

As the title says I want to move my current installation from my HDD to a SSD I just bought and installed. I've been reading a lot of information on the wiki about SSD and NVMe. I also have found some topics about it here in the forums like these: HDD to SSD Without Reinstalling or best way to move gentoo . hdd -> ssd. I also stumbled this Reddit post. But as I read from all this sources some questions emerged and each case seems to use a different method to move the installation. So I thought listing below my questions.

Slowing wear:
Quote:
A basic method increasing SSD lifespan is to uniformly distribute writes across all the blocks. This method is called wear leveling and is deployed via SSD firmware.

How do I do that?

Partitioning:
Quote:
For optimal performance filesystem data structures should aim not to cross boundaries of underlying SSD internal data structures. Thus effectively minimizing the number of required internal SSD operations. This can be achieved by aligning start of each partition — the common alignment is to 1 MiB.
Both parted and fdisk partitioning utilities support partition alignment. For parted, there is -a optimal option. Recent versions of fdisk should use optimal alignment by default.

So if I understood correctly if I use fdisk I should not worry about it, because fdisk does it automatically, right?

Under blkdiscard it speaks about LVM and LUKS. I never used it before. Will I need it? Is it recommended for any reason that I should know of?

Under Configuring for erase block size
Quote:
When device's erase block size is known, it can be used when creating a filesystem.
Where can I find it? I tried to search it but could not find anything. Is there any software that can give me this information?

As I use TMPDIR on tmpfs and have a swapfile instead of a partition I'm worried that large packages as firefox will try to use my SSD while compiling. How can I avoid it?
I'm thinking about create a partition on my HDD when I've accomplished moving the current installation to my SSD. Will it avoid compiling things on my SSD?

Is there any recommendations/links/ideas in how to proceed with the moving?

I don't know if it is relevant but here is some information about my SSD:
Kingston’s NV2 PCIe 4.0 NVMe SSD Gen 4x4

I'm thinking to use partition same as I have now:
Code:
Number  Start   End     Size   File system  Name  Flags
 1      1049kB  269MB   268MB  fat32        ESP   boot, esp
 2      269MB   107GB   107GB  ext4         ROOT
 3      107GB   1000GB  893GB  ext4         HOME

Thank you all in advance. =]
PS: I don't know if this belongs to 'Installing Gentoo'. If not I'm sorry.

EDIT: from this reddit post
Code:
 Copying the installation is pretty simple. People usually have problems dealing with the boot loaders/boot managers part.

Copying the installation:

After created the subvolumes, copy your old root to your new one with:

rsync -aAXv /path/to/old/root/* /path/to/new/root/subvolume/

    -a -> archive mode

    -A -> preserve ACLs

    -X -> preserve extended attributes

    -v -> increase verbosity

I'm assuming you'll be doing the same for your home

I'm using efibootmgr, so I guess I'm safe with the problem most people have? I think after using the rsync command above I just need to change the kernel settings and fstab, right?


Last edited by sokrovenno on Tue Jan 30, 2024 12:03 pm; edited 3 times in total
Back to top
View user's profile Send private message
papu
l33t
l33t


Joined: 25 Jan 2008
Posts: 713
Location: Sota algun pi o alzina...

PostPosted: Sat Jan 27, 2024 1:17 pm    Post subject: Reply with quote

the best way for me is making a backup of current gentoo with rsync then do the same partitioning over nvme that you had in the ssd and then pass the backup to the new mvme from a isolive

is not easy to explain that with my poor english , just learn how to use rsync to do backups and practise a lot before do dangerous things like that

i get you the command i use to do that:

the backup from ssd --> sudo rsync -aAXHS --info=progress2 --exclude-from=/home/user/exclude_files / /mnt/sources/BCKUP_gentoo/

recover the backup to nvme --> sudo rsync -aAXHS --info=progress2 /mnt/sources/BCKUP_gentoo/ /

the exclude_files is a text file that i use for the exclusion of files or dirctorys i don't want to the backup, some like that:
Quote:
/dev/*
/home/user/.cache/*
/home/user/.local/share/Steam/*
/home/user/.local/share/TelegramDesktop/tdata/user_data/*
/home/user/.local/share/Trash/*
/home/user/.local/share/baloo/*
/home/user/.local/share/wineprefixes/*
/home/user/.wine/*
/home/user/Downloads/*
/lost+found/*
/media/*
/mnt/*
/proc/*
/root/.cpan/*
/run/*
/sys/*
/tmp/*
/usr/src/*
/var/cache/*
/var/log/*
/var/tmp/*


there are guis for rsync but i use comand line way , i not use luks but might be the same stuff

:roll:
_________________
"~amd64" --cpu 7700 non-x --DDR5 2x16GB 6000MHz --gpu RX 470


Last edited by papu on Sat Jan 27, 2024 1:31 pm; edited 2 times in total
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 439

PostPosted: Sat Jan 27, 2024 1:25 pm    Post subject: Reply with quote

I'm just a knuckle dragging user, others can comment on the best technical way to use your ssd.

I fairly regularly rsync one drive (sd card, usb thumb drive, or usb ssd) to another while playing with Pi's and Gentoo. It works well, as long as you use lsblk to make sure you are sending to the mounted partition that you think you are. Yes, I've missed and sent it the wrong way, or to the wrong place.

Remember lsblk to confirm you are mounted as you intend.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sat Jan 27, 2024 4:17 pm    Post subject: Reply with quote

I would recommend the following procedure:

Preparatory work:

1. install the SSD and leave your old HD in your machine as well.
2. partition and format your SSD. But dont enable the new ESP (on your SSD) as ESP right now (= dont do "t" in fdisk).
( https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Creating_the_EFI_System_Partition_.28ESP.29 )
See also: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Boot_kernel_via_UEFI#Prerequisites_for_an_UEFI_boot
3. If you need a new kernel (because you had NVME disabled and have to enable it) configure it and "make" it. Dont install it right now (we do later). If you have configured your root= INTO your kernel, then please dont forget to update CONFIG_CMDLINE=... ;-)

Copying:

1. Boot with our GentooMinimalCD (or AdminCD). This has the advantage that no files on your old HD are in use. Another advantage is that you can edit your new /etc/fstab immediately and also create the new boot entries for UEFI with "efibootmgr" (see below).
2. Do not chroot into your (old) Gentoo system, but mount your (old) root partition to /mnt/gentoo (and your old /home to /mnt/gentoo/home if you have an additional partition for it). DONT mount your ESP (of your old HD).
3. mkdir a /mnt/ssd/root and /mnt/ssd/root/home and mount both partitions of your ssd to this.
4. Copy from hd to ssd. I also recommend the use of rsync:
Code:
# rsync --stats --progress --numeric-ids -aXAhHSP  /mnt/gentoo /mnt/ssd/root

5. Edit the new /mnt/ssd/root/etc/fstab

Relocation:

1. Start "fdisk" or "parted" and activate your new ESP (of SSD) AS ESP (= the "t" command) or in "parted": "set 1 boot on" (if your new ESP is first partition of your new SSD)
2. mkdir /mnt/ssd/root/efi and mount your new ESP (of SSD) to it
3. mkdir -p /mnt/ssd/root/efi/efi/XXXXXX (what you like) and copy your (newly built) kernel to it (e.g from /mnt/gentoo/usr/src/linux/arch/.... ) as *.efi !! (I am sure you know this aleady ;-) )
4. Disable the old ESP (from your HD) with "parted /dev/OLDHD" and "set 1 boot off" (if old ESP was/is first partition of your old HD).
5. umount all
6. REBOOT AGAIN INTO GentooMinimalCD. This is necessary for UEFI, so UEFI dont use the old ESP (of your HD) and use now the new ESP (of your SSD).
7. Create now the UEFI entry with "efibootmgr -c ...."
8. reboot
9. Check if all is correct.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2966
Location: Edge of marsh USA

PostPosted: Sat Jan 27, 2024 10:19 pm    Post subject: Reply with quote

Take note of this possibly more complete/appropriate rsync backup reference:
https://wiki.archlinux.org/index.php/rsync#Full_system_backup
Which in short shows:
Code:
rsync -aAXHv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*"
,"/media/*","/lost+found"} /* /path/to/backup/

_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sat Jan 27, 2024 11:41 pm    Post subject: Reply with quote

figueroa wrote:
Take note of this possibly more complete/appropriate rsync backup reference:
https://wiki.archlinux.org/index.php/rsync#Full_system_backup
Which in short shows:
Code:
rsync -aAXHv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*"
,"/media/*","/lost+found"} /* /path/to/backup/

I got my command from an expert ... and I have done it with my command already (before many years) ... so, it is verified by myself ... AND:

If you boot with our GentooMinimalCD and mount your old root partition to /mnt/gentoo THEN you should have no (problem-)files in /mnt/gentoo/dev .../proc .../run and .../sys BUT you want copy the (empty) directories ALL to the new SSD. So, there is no need to exclude something.

Be aware: Your example wants to BACKUP FROM (=inside) a WORKING system; here you dont need "--numeric-ids". BUT you really should use it when we copy FROM "outside".
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 65

PostPosted: Sun Jan 28, 2024 1:12 am    Post subject: Reply with quote

Hey Pietinger. I'm very grateful for your help once again. :)
But although I followed every step of your procedure only my hdd is booting even though I've disabled the 'esp' from hdd.
I'm not sure what should I do. :oops:
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 1:32 am    Post subject: Reply with quote

Do you get an error somewhere ?

Please boot normal to your HD and do:

1. mkdir /mnt/ssd
2. mount /dev/nvme0n1pX /mnt/ssd (use X as number of your NEW root partition)
3. mkdir /mnt/ssd/efi
4. mount /dev/nvme0n1pY /mnt/ssd/efi (use Y as number of your NEW ESP ... usually 1)

Please give us the output of:

- lsblk
- blkid
- parted -l
- efibootmgr
- mount
- ls -lR /efi/efi (maybe you must mount it also before if you have in your old fstab the parameter: noauto)
- ls -lR /mnt/ssd/efi/efi
- more /etc/fstab
- more /mnt/ssd/etc/fstab

and check if your /mnt/ssd looks like your (new) root partition ... I mean: If there is all what you expect to be

... and please wait (maybe until tomorrow; I have to go to bed now) ... if your old system boots we are not in hurry ;-)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2966
Location: Edge of marsh USA

PostPosted: Sun Jan 28, 2024 1:43 am    Post subject: Reply with quote

pietinger,

I'm not criticizing, far be it from me to presume to do so, but providing additional information with a reference that I have found to be particularly useful to me.

In practice, I use many excludes and call them from a separate file containing the following:
Code:
dev/*
home/*/*
home/lost+found
lost+found
media/*/*
mnt/*/*
proc/*
root/.cache/*
root/.thumbnails/*
root/.dbus/session-bus/*
run/*
scratch/*
sys/*
tmp/*
var/cache/distfiles/*
var/log/portage/*
var/tmp/*

Also, as may be noted in the above list, I handle everything in /home separately except for the user's home directories. I feed the same exclusions file into the creation of a compressed tar archive, stage4.tar.zst, giving me a reasonably small and portable full system backup (minus /home).

The reason for handling /home separately is that a compressed archive of /home runs about 160G, whereas the base system is currently only 5.3G.

Kind regards, and thank you for your many helpful contributions here in the forums
_________________
Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 1:53 am    Post subject: Reply with quote

figueroa wrote:
pietinger,

I'm not criticizing, far be it from me to presume to do so, but providing additional information with a reference that I have found to be particularly useful to me.

figueroa,

I am far away to take it as criticizing ... and you are absolutely right for providing additional informations ... I like that ... but I also dont want confuse @sokrovenno: We have here a situation where we must CLONE a root partition (with /home) from one HD to a new SSD. This should be done in a way that everything will be copied. Yes, you are right, when doing BACKUPs it is senseful to not copy everything. (I dont do a complete backup of my system; only /etc and /home; to 2 different external USB-SSDs; without compression)

figueroa wrote:
Kind regards, and thank you for your many helpful contributions here in the forums

I think (hope) you surely know that you are very Welcome ! So, my kind regards back to you :D
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 12:17 pm    Post subject: Reply with quote

P.S.:

sokrovenno, please give us also the output of "cat /proc/cmdline"
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 65

PostPosted: Sun Jan 28, 2024 12:29 pm    Post subject: Reply with quote

I think I may have missed a step on making the new kernel. I did not used make modules_install :oops:
I'm sorry, I got a little confused with:
Pietinger wrote:
3. If you need a new kernel (because you had NVME disabled and have to enable it) configure it and "make" it. Dont install it right now (we do later).

Should I rsync the whole system or just /usr will be okay?

Pietinger wrote:
Do you get an error somewhere ?

Not that I'm aware of. But not sure where I should look for an error.

Here is what you asked:

lsblk:
Code:
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 931.5G  0 disk
├─sda1        8:1    0   256M  0 part
├─sda2        8:2    0  99.8G  0 part /
└─sda3        8:3    0 831.5G  0 part /home
nvme0n1     259:0    0 931.5G  0 disk
├─nvme0n1p1 259:1    0     1G  0 part /mnt/ssd/root/efi
├─nvme0n1p2 259:2    0   100G  0 part /mnt/ssd/root
└─nvme0n1p3 259:3    0 830.5G  0 part


blkid:
Code:
/dev/nvme0n1p3: UUID="806a367d-be15-414a-af51-ada65d66c4bb" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="HOME" PARTUUID="da8acd37-6d87-854d-b873-71ff43813346"
/dev/nvme0n1p1: UUID="BD11-25EA" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="ESP" PARTUUID="1c6dcbae-af8d-b24f-b096-b626e61cfdcf"
/dev/nvme0n1p2: UUID="33bfcc4c-4f62-451f-a82f-787ece6ce0ed" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="ROOT" PARTUUID="26acf7d7-e617-284c-858a-27d0ad42bc1a"
/dev/sda2: UUID="c18bd639-f7a6-43c1-a987-b37162001cb8" BLOCK_SIZE="1024" TYPE="ext4" PARTLABEL="ROOT" PARTUUID="9a6abc72-862f-4444-bf04-9c37592031e5"
/dev/sda3: UUID="bb87e383-e74a-4e2b-b791-4d4913775bfe" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="HOME" PARTUUID="37f62d4b-7d45-6d4b-bac6-292b63054247"
/dev/sda1: UUID="DEFB-1341" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="ESP" PARTUUID="dcc34a59-57e2-194b-8661-9d1000130a97"


parted -l:
Code:
Model: ATA WDC WD10SPZX-35Z (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size   File system  Name  Flags
 1      1049kB  269MB   268MB  fat32        ESP   msftdata
 2      269MB   107GB   107GB  ext4         ROOT
 3      107GB   1000GB  893GB  ext4         HOME


Model: KINGSTON SNV2S1000G (nvme)
Disk /dev/nvme0n1: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  1075MB  1074MB  fat32        ESP   boot, esp
 2      1075MB  108GB   107GB   ext4         ROOT
 3      108GB   1000GB  892GB   ext4         HOME


efibootmgr:
Code:
BootCurrent: 0006
Timeout: 2 seconds
BootOrder: 0001,0006,0007,0008,0009
Boot0001* SSD   HD(1,GPT,dcc34a59-57e2-194b-8661-9d1000130a97,0x800,0x80000)/File(\EFI\SSD\BZIMAGE.EFI)/dev/nvme0n1
Boot0006* Gentoo   HD(1,GPT,dcc34a59-57e2-194b-8661-9d1000130a97,0x800,0x80000)/File(\EFI\GENTOO\BZIMAGE.EFI)72006f006f0074003d002f006400650076002f007300640061003200200072006f00
Boot0007* Backup   HD(1,GPT,dcc34a59-57e2-194b-8661-9d1000130a97,0x800,0x80000)/File(\EFI\BACKUP\BZIMAGE.EFI)
Boot0008* Secure   HD(1,GPT,dcc34a59-57e2-194b-8661-9d1000130a97,0x800,0x80000)/File(\EFI\SECURE\BZIMAGE.EFI)
Boot0009* UEFI OS   HD(1,GPT,dcc34a59-57e2-194b-8661-9d1000130a97,0x800,0x80000)/File(\EFI\BOOT\BOOTX64.EFI)0000424f


mount:
Code:
/dev/sda2 on / type ext4 (rw,noatime,stripe=4)
devtmpfs on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=10240k,nr_inodes=2037088,mode=755)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=3260284k,nr_inodes=819200,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda3 on /home type ext4 (rw,noatime)
tmpfs on /var/tmp/portage type tmpfs (rw,relatime,size=12582912k,mode=775,uid=250,gid=250)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1630140k,nr_inodes=407535,mode=700,uid=1000,gid=1000)
/dev/nvme0n1p2 on /mnt/ssd/root type ext4 (rw,relatime)
/dev/nvme0n1p1 on /mnt/ssd/root/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)


ls -lR /efi/EFI
Code:
/efi/EFI/:
total 4
drwxr-xr-x 2 root root  512 22 jan 18:25 backup
drwxr-xr-x 2 root root  512 28 feb  2023 BOOT
drwxr-xr-x 3 root root  512  5 okt 17:42 EFI
drwxr-xr-x 2 root root  512 20 jan 14:10 example
drwxr-xr-x 2 root root 1024 26 jan 23:57 gentoo
drwxr-xr-x 2 root root  512 20 jan 14:24 secure

/efi/EFI/backup:
total 12887
-rwxr-xr-x 1 root root 13196224 22 jan 18:22 gentoo-6.1.67.efi

/efi/EFI/BOOT:
total 132
-rwxr-xr-x 1 root root 135168 11 sep 08:01 BOOTX64.EFI

/efi/EFI/EFI:
total 1
drwxr-xr-x 2 root root 512  5 okt 17:43 BOOT

/efi/EFI/EFI/BOOT:
total 132
-rwxr-xr-x 1 root root 135168  5 okt 17:43 BOOTX64.EFI

/efi/EFI/example:
total 0

/efi/EFI/gentoo:
total 79720
-rwxr-xr-x 1 root root 13394528 26 jan 23:57 bzImage.efi
-rwxr-xr-x 1 root root 13243904 24 jan 10:43 gentoo-6.1.67-1.efi
-rwxr-xr-x 1 root root 13308448 24 jan 10:43 gentoo-6.1.67-2.efi
-rwxr-xr-x 1 root root 13383840 25 jan 09:00 gentoo-6.1.67-3.efi
-rwxr-xr-x 1 root root 13196224 21 jan 12:38 gentoo-6.1.67.efi
-rwxr-xr-x 1 root root 15104800 23 jan 23:32 gentoo-6.6.13.efi

/efi/EFI/secure:
total 13158
-rwxr-xr-x 1 root root 13472960 20 jan 15:40 bzImage.efi


ls -lR /mnt/ssd/root/efi/EFI:
Code:
/mnt/ssd/root/efi/EFI/:
total 4
drwxr-xr-x 2 root root 4096 27 jan 21:32 ssd

/mnt/ssd/root/efi/EFI/ssd:
total 13084
-rwxr-xr-x 1 root root 13394528 27 jan 21:32 bzImage.efi


more /etc/fstab:
Code:
#/dev/sda1 [BOOT]
UUID=DEFB-1341   /efi   vfat   noauto,noatime   1 2

#/dev/sda2 [ROOT]
UUID=c18bd639-f7a6-43c1-a987-b37162001cb8   /   ext4   noatime   0 1

#/dev/sda3 [HOME]
UUID=bb87e383-e74a-4e2b-b791-4d4913775bfe   /home   ext4   noatime   0 2

#/swapfile [SWAP]
/swapfile   none   swap   defaults   0 0
#UUID=b200f8bc-86df-477b-be1f-43838cfed7ba   none   swap   sw   0 0

#STEAM
#<fs>      <mountpoint>    <type>   <opts>           <dump/pass>
#shm        /dev/shm        tmpfs        nodev,nosuid,noexec,size=768M  0 0

#TMPFS
#tmpfs      /var/tmp/portage      tmpfs   size=3G,uid=portage,gid=portage,mode=775,nosuid,noatime,nodev   0 0
tmpfs      /var/tmp/portage      tmpfs   size=12G,uid=portage,gid=portage,mode=775   0 0


more /mnt/ssd/root/etc/fstab
Code:
#/dev/sda1 [BOOT]
UUID=BD11-25EA   /efi   vfat   noauto,noatime   1 2

#/dev/sda2 [ROOT]
UUID=33bfcc4c-4f62-451f-a82f-787ece6ce0ed   /   ext4   noatime   0 1

#/dev/sda3 [HOME]
UUID=806a367d-be15-414a-af51-ada65d66c4bb   /home   ext4   noatime   0 2

#/swapfile [SWAP]
/swapfile   none   swap   defaults   0 0
#UUID=b200f8bc-86df-477b-be1f-43838cfed7ba   none   swap   sw   0 0

#STEAM
#<fs>      <mountpoint>    <type>   <opts>           <dump/pass>
#shm        /dev/shm        tmpfs        nodev,nosuid,noexec,size=768M  0 0

#TMPFS
#tmpfs      /var/tmp/portage      tmpfs   size=3G,uid=portage,gid=portage,mode=775,nosuid,noatime,nodev   0 0
tmpfs      /var/tmp/portage      tmpfs   size=12G,uid=portage,gid=portage,mode=775   0 0


Pietinger wrote:
and check if your /mnt/ssd looks like your (new) root partition

Looks like everything is in there.


EDIT:
Pietinger wrote:
P.S.:

sokrovenno, please give us also the output of "cat /proc/cmdline"

root=PARTUUID=9a6abc72-862f-4444-bf04-9c37592031e5 ro root=/dev/sda2 ro
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 1:07 pm    Post subject: Reply with quote

Do you get a kernel panic if you select in your BIOS the entry "SSD" ?

I assume that you have NOT root=... in the kernel (in built-in kernel command line), but want to pass it from UEFI (which works also) ... If my assumption is correct, it is wrong, because you made entry 1 with -u "/dev/nvme0n1" when you created it (double wrong: missing p2 and missing root=):
Code:
Boot0001* SSD   HD(1,GPT,dcc34a59-57e2-194b-8661-9d1000130a97,0x800,0x80000)/File(\EFI\SSD\BZIMAGE.EFI)/dev/nvme0n1

But it must be -u "root=/dev/nvme0n1p2" ...

We also have the problem, that your system STILL uses the first partition of you (old) /dev/sda as ESP ... MAYBE this is because it has the flag:
Code:
 1      1049kB  269MB   268MB  fat32        ESP   msftdata

(maybe once there was a windows on your sda)

A third problem is your "new" fstab ... it is the old one.

So, I suggest to do these steps:


1. We destroy /dev/sda1 with:
Code:
# parted /dev/sda
> rm 1
> q

(as long as we can boot with a GentooAdminCD, and chroot into our system if necessary, it shouldn't be dangerous)

2. Do a reboot (without any USB stick)

3. Does your system say it cannot find a bootable system ?

If yes, then we are on a good way.

4. Boot again] ... but now with your USB of our GentooAdminCD (or MinimalCD)

5. mount /dev/nvme0n1p2 /mnt/gentoo

6. edit /mnt/gentoo/etc/fstab and give it the new partitions ... example:
Code:
# ESP
/dev/nvme0n1p1   /efi   vfat   noauto,noatime   1 2

# ROOT
/dev/nvme0n1p2   /   ext4   noatime   0 1

# [HOME
/dev/nvme0n1p3   /home   ext4   noatime   0 2


7. Create again the UEFI entry for your new kernel:
Code:
efibootmgr -c  -d /dev/nvme0n1 -L "SSD" -l "\EFI\SSD\BZIMAGE.EFI" -u "root=/dev/nvme0n1p2"


8. umount /mnt/gentoo

9. reboot without USB
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 65

PostPosted: Sun Jan 28, 2024 1:33 pm    Post subject: Reply with quote

Pietinger wrote:
Do you get a kernel panic if you select in your BIOS the entry "SSD" ?

No, It just boots the next entry.

Quote:
I assume that you have NOT root=... in the kernel (in built-in kernel command line)

CONFIG_CMDLINE="root=PARTUUID=26acf7d7-e617-284c-858a-27d0ad42bc1a ro"

Quote:
But it must be -u "root=/dev/nvme0n1p1" ...

I did not used the -u flag. I just used efibootmgr -c /dev/nvme0n1 -L "SSD" -l "\efi\ssd\bzImage.efi". But I really forgot the p1. Sorry.
I tried efibootmgr -c -d /dev/nvme0n1 -L "SSD" -l "\efi\ssd\bzImage.efi". But for some reason it did not appeared when I did efibootmgr.

Quote:
(maybe once there was a windows on your sda)

Yeah, my notebook came with Windows when I bought it.

Quote:
A third problem is your "new" fstab ... it is the old one.

I just copied what I had and changed just the UUID. I forgot to change the lables, but I think it is right.

I think I may have missed a step on making the new kernel. I did not used make modules_install :oops:
I'm sorry, I got a little confused with:
Pietinger wrote:
3. If you need a new kernel (because you had NVME disabled and have to enable it) configure it and "make" it. Dont install it right now (we do later).

Should I rsync the whole system or just /usr will be okay?

EDIT: I tried to reboot, but now UEFI have no options. It just detects my USB stick.
I followed the steps above. But for some reason efibootmgr returns this:
Code:
gentoo@livecd / $ efibootmgr
BootCurrent: 0009
Timeout: 2 seconds
BootOrder: 0009,0006,0007,0008
Boot0006* Gentoo        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)72006f006f0074003d002f006400650076002f007300640061003200200072006f00
Boot0007* Backup        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0008* Secure        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0009* UEFI: SanDisk Cruzer Blade 1.26       PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(2,GPT,4d4c68f9-3e96-4eda-998e-d69950fba76d,0x234,0x1680)0000424f

When I use -d on the command efibootmgr -c -d /dev/nvme0n1 -L "SSD" -l "\EFI\SSD\BZIMAGE.EFI" -u "root=/dev/nvme0n1p2" the SSD boot entry does not appear on the command above.

The man efibootmgr says:
Quote:
-d | --disk DISK
The disk containing the loader (defaults to /dev/sda).

Should I omit the -d ?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 3:18 pm    Post subject: Reply with quote

sokrovenno wrote:
Should I omit the -d ?

Please no.

Please boot now your USB stick and do (exactly):
Code:
efibootmgr -c  -d /dev/nvme0n1 -L "SSD" -l "\EFI\SSD\BZIMAGE.EFI"

and then check with "efibootmgr" if you get the new entry.
Please check also with "parted -l" again, if your first partition of SSD has still boot flag. (please stay here; I am online now)


P.S.: the problem with cloning is not copying from one disk to another (rsync does always a good job); the main problem is always moving the ESP.
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 3:25 pm    Post subject: Reply with quote

sokrovenno wrote:
I just copied what I had and changed just the UUID. I forgot to change the lables, but I think it is right.

Yes, you are right ... I am sorry ... sometimes I am completely blind :oops:
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 3:31 pm    Post subject: Reply with quote

If above does not work, please try:

1. Remove the old HD from your mainboard (only SATA-cable)
2. Reboot
3. Reboot with Gentoo-USB
4. check "efibootmgr"
5. Again create it with: efibootmgr -c -d /dev/nvme0n1 -L "SSD" -l "\EFI\SSD\BZIMAGE.EFI"
6. again check "efibootmgr"
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 3:39 pm    Post subject: Reply with quote

P.S.: Please check also:
Code:
$ efibootmgr -V
version 18

(If it is not 18 THEN you have an old LiveUSB and then you need "efibootmgr -v" to see all)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 65

PostPosted: Sun Jan 28, 2024 3:49 pm    Post subject: Reply with quote

Quote:
Please boot now your USB stick and do (exactly):

efibootmgr -c -d /dev/nvme0n1 -L "SSD" -l "\EFI\SSD\BZIMAGE.EFI"

and then check with "efibootmgr" if you get the new entry.

Okay, now it appeared.
Code:
gentoo@livecd / $ efibootmgr
BootCurrent: 0009
Timeout: 2 seconds
BootOrder: 0000,0009,0006,0007,0008
Boot0000* SSD   HD(1,GPT,1c6dcbae-af8d-b24f-b096-b626e61cfdcf,0x800,0x200000)/File(\EFI\SSD\bzImage.efi)
Boot0006* Gentoo        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)72006f006f0074003d002f006400650076002f007300640061003200200072006f00
Boot0007* Backup        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0008* Secure        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0009* UEFI: SanDisk Cruzer Blade 1.26       PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(2,GPT,4d4c68f9-3e96-4eda-998e-d69950fba76d,0x234,0x1680)0000424f


Quote:
Please check also with "parted -l" again, if your first partition of SSD has still boot flag
.
Yes, it has the boot flag.
Code:
Model: KINGSTON SNV2S1000G (nvme)
Disk /dev/nvme0n1: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  1075MB  1074MB  fat32        ESP   boot, esp
 2      1075MB  108GB   107GB   ext4         ROOT
 3      108GB   1000GB  892GB   ext4         HOME


Quote:
Yes, you are right ... I am sorry ... sometimes I am completely blind

Oh that is okay. You don't have to apologize.

Code:
gentoo@livecd / $ efibootmgr -V
version 18

Yes my LiveCD is a little old, last year I think. But it has the right efibootmgr version.


Since I have made some mistakes I re-initialized the whole process, because I thought that not making modules_install could have be part of the problems.
I'm rsyncing again. It should end soon. Sorry, I thought you maybe got tired of helping a noob after you have given specific instructions and I could not follow it right. xD

After I read the wiki about SSD I'm a little confused and worried. Should I treat the SSD as my old HDD or it should have any "special" treatment?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 4:03 pm    Post subject: Reply with quote

sokrovenno wrote:
Since I have made some mistakes I re-initialized the whole process, because I thought that not making modules_install could have be part of the problems.

Maybe this is not necessary ... everything is (was?) looking good now ... (I think a "make modules_install" is not necessary if you change only the built-in kernel command line, because there is no change in any modules)

sokrovenno wrote:
[...] Sorry, I thought you maybe got tired of helping a noob after you have given specific instructions and I could not follow it right. xD

Friendly and kind people I help always ... AND ... you are not a noob anymore ... (what we are doing is sometimes problematic even for experts) ... You have surely done everything right ... I assume that this step:
Quote:
4. Disable the old ESP (from your HD) with "parted /dev/OLDHD" and "set 1 boot off" (if old ESP was/is first partition of your old HD).

did not have worked because it is also a "msftdata" partition ... if this is true then I have learned something new also.

sokrovenno wrote:
After I read the wiki about SSD I'm a little confused and worried. Should I treat the SSD as my old HDD or it should have any "special" treatment?

I know this article, and yes, I am using something form this article:
1. discard
2. tmpfs for portage
3. https://wiki.gentoo.org/wiki/SSD#XDG_cache_on_tmpfs (*)


*) see also in my last installation from last year in step A.3.7 https://wiki.gentoo.org/wiki/User:Pietinger/temp/delete_me
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 65

PostPosted: Sun Jan 28, 2024 4:18 pm    Post subject: Reply with quote

Okay, rsync is done. I did everything that should be done.Fstab is okay. The SSD entry appeared on efibootmgr before I reboot. But for some reason it was not appearing on the BIOS. And after I booted the LiveCD again it disappeared.
It was like this:
Code:
gentoo@livecd / $ efibootmgr
BootCurrent: 0009
Timeout: 2 seconds
BootOrder: 0000,0009,0006,0007,0008
Boot0000* SSD   HD(1,GPT,1c6dcbae-af8d-b24f-b096-b626e61cfdcf,0x800,0x200000)/File(\EFI\SSD\bzImage.efi)
Boot0006* Gentoo        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)72006f006f0074003d002f006400650076002f007300640061003200200072006f00
Boot0007* Backup        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0008* Secure        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0009* UEFI: SanDisk Cruzer Blade 1.26       PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(2,GPT,4d4c68f9-3e96-4eda-998e-d69950fba76d,0x234,0x1680)0000424f


And now it is like this:
Code:
gentoo@livecd / $ efibootmgr
BootCurrent: 0009
Timeout: 2 seconds
BootOrder: 0009,0006,0007,0008
Boot0006* Gentoo        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)72006f006f0074003d002f006400650076002f007300640061003200200072006f00
Boot0007* Backup        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0008* Secure        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0009* UEFI: SanDisk Cruzer Blade 1.26       PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(2,GPT,4d4c68f9-3e96-4eda-998e-d69950fba76d,0x234,0x1680)0000424f

All I've done was reboot. I don't know what is going on.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 4:32 pm    Post subject: Reply with quote

sokrovenno wrote:
All I've done was reboot. I don't know what is going on.

A UEFI system deletes an entry if it is not correct. Please boot with USB and mount your 1. parition of SSD to /mnt/gentoo (mount /dev/nvme0n1p1 /mnt/gentoo) and then give us: "ls -lR /mnt/gentoo"

P.S.: A short question: Do you have Libera IRC ? If yes, please go to #gentoo-forums (I am online there)
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 65

PostPosted: Sun Jan 28, 2024 4:34 pm    Post subject: Reply with quote

Code:
livecd / # ls -lR /mnt/ssd/efi/
/mnt/ssd/efi/:
total 4
drwxr-xr-x 3 root root 4096 Jan 28 01:01 EFI

/mnt/ssd/efi/EFI:
total 4
drwxr-xr-x 2 root root 4096 Jan 27 21:32 ssd

/mnt/ssd/efi/EFI/ssd:
total 13084
-rwxr-xr-x 1 root root 13394528 Jan 28 10:35 bzImage.efi
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4323
Location: Bavaria

PostPosted: Sun Jan 28, 2024 4:37 pm    Post subject: Reply with quote

Please umount and do exactly I wrote ... I want to see the complete content of nvme0n1p1
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
sokrovenno
n00b
n00b


Joined: 23 Aug 2023
Posts: 65

PostPosted: Sun Jan 28, 2024 4:43 pm    Post subject: Reply with quote

Oh, I'm sorry. Here it is:
Code:
livecd / # ls -lR /mnt/gentoo
/mnt/gentoo:
total 4
drwxr-xr-x 3 root root 4096 Jan 28 01:01 EFI

/mnt/gentoo/EFI:
total 4
drwxr-xr-x 2 root root 4096 Jan 27 21:32 ssd

/mnt/gentoo/EFI/ssd:
total 13084
-rwxr-xr-x 1 root root 13394528 Jan 28 10:35 bzImage.efi


Quote:
P.S.: A short question: Do you have Libera IRC ? If yes, please go to #gentoo-forums (I am online there)

I never used IRC. I was researching it two or three days ago to see how to use it. But did not end my research because I was anxious to install my SSD and a new RAM memory.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum