Forums

Skip to content

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

Upgrading internal SSD

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
7 posts • Page 1 of 1
Author
Message
Jimmy2027
n00b
n00b
Posts: 50
Joined: Tue May 12, 2020 12:56 pm

Upgrading internal SSD

  • Quote

Post by Jimmy2027 » Thu Dec 16, 2021 10:33 am

Hello, I would like to upgrade the internal SSD storage of my laptot, from 300G to 1000G.

For this I was thinking of doing the following steps:
1. mount new SSD with USB
2. format the new SSD with fdisk
3. copy everything from old SSD to new SSD with:

Code: Select all

 rsync -aAHXv / --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /mnt/MyNewSSD/
4. install the bootloader on the new SSD with chroot from liveusb
5. physically remove old SSD and insert new SSD

Would this work in theory?

A few questions regarding this:
* When chrooting from liveusb what steps do I have to do in order to install the bootloader? Do I have to mount the same directories as described in the installation handbook
* The new SSD is accessed from /dev/nvme0n1 while the old one is accessed from /dev/sda. Is there anywhere other than the fstab file where this difference matters?

Thanks for your help :)
Top
carcajou
Apprentice
Apprentice
User avatar
Posts: 256
Joined: Tue Jun 10, 2008 6:30 pm

  • Quote

Post by carcajou » Thu Dec 16, 2021 11:32 am

It should work. I did pretty much the same thing...

My current Gentoo install started in VM, then moved to my internal HDD (used only for backups) for compilation speed-up and after I set everything the way I wanted - I booted SysRescueCD from usb flash, re-partitioned my SSD (BIOS boot partition, /boot partition + LVM), mounted new partitions and copied Gentoo install from HDD to SSD (just mind the flags for cp to keep the permissions and other properties; I did not use rsync).

After everything was copied: chroot-ed (the way it is described in handbook), fixed fstab and reinstalled GRUB to /dev/nvme0n1.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56075
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Thu Dec 16, 2021 11:47 am

Jimmy2027,

No. It will fail because of all the open files on the the old SSD. Well, the copy will not fail but the result will not work.

Attach the new SSD via USB.
Boot some live media.

mkdir /mnt/old
mkdir /mnt/new

Partition the new SSD.
Make filesystems on the new SSD.
Mount the filesystem tree at /mnt/new.
You will need to make /mnt/new/boot and so on as you go.

Mount the old directory tree at /mnt/old with the read only option.
This will prevent you ruining your mid winter festivities if you mess up the direction of the copy. :)

Copy the old filesystem tree to the new one. cp -a will do. There is nothing to exclude except maybe /mnt/old//media/* as everything else will be empty.

If you UEFI boot. That's it.
If you BIOS boot, the bits of the boot loader outside of the filesystem need to be reinstalled, as you say, as they are not copied.
That could be copied with dd if you are very careful.

Now you have two *identical* filesystem trees.
If you intend to boot the old SSD elsewhere, you should change hostnames and host keys on one of the systems.
Hostnames will stop you getting confused.
Host keys will stop remote systems getting confused.

If you have ever set WiFi MAC addresses by hand, having two identical MAC Addresses on the same network won't work.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
figueroa
Advocate
Advocate
User avatar
Posts: 3032
Joined: Sun Aug 14, 2005 8:15 pm
Location: Edge of marsh USA
Contact:
Contact figueroa
Website

  • Quote

Post by figueroa » Fri Dec 17, 2021 4:04 am

Restore from a system backup. See my script for a stage4 backup in the following thread:
https://forums.gentoo.org/viewtopic-t-1132899.html

You need a backup routine anyway, so start now.

After installing the restore, edit /etc/fstab if there were any changes, install the boot loader, and your done.
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 -wayland
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

Re: Upgrading internal SSD

  • Quote

Post by mike155 » Fri Dec 17, 2021 4:37 am

Jimmy2027 wrote:* The new SSD is accessed from /dev/nvme0n1 while the old one is accessed from /dev/sda. Is there anywhere other than the fstab file where this difference matters?

Code: Select all

cd /etc
grep -r sda .
cd /boot
grep -r sda .
There could be entries in /etc/smartd.conf or in /etc/crypttab, for example.
Top
figueroa
Advocate
Advocate
User avatar
Posts: 3032
Joined: Sun Aug 14, 2005 8:15 pm
Location: Edge of marsh USA
Contact:
Contact figueroa
Website

Re: Upgrading internal SSD

  • Quote

Post by figueroa » Fri Dec 17, 2021 5:09 am

mike155 wrote:
Jimmy2027 wrote:* The new SSD is accessed from /dev/nvme0n1 while the old one is accessed from /dev/sda. Is there anywhere other than the fstab file where this difference matters?

Code: Select all

cd /etc
grep -r sda .
cd /boot
grep -r sda .
There could be entries in /etc/smartd.conf or in /etc/crypttab, for example.
If you are asking about my stage4 script, yes, there could be. Thank you for asking. Your search (with grep) should have found them. For example, I have /dev/sda and /dev/sdb in my /etc/smartd.conf. Users that have such configurations will have to make other adjustments according to their system. /etc/smartd.conf is not a show stopper. Users should notice the errors. I don't know about /etc/crypttab as I'm not using it.

I do use my stage4 script and restore from the resulting archive in order to have a working backup partition on the 2nd hard drive and to move Gentoo between computers, and I test the results. (Rebuilding may be necessary if the computer architectures are not compatible, but that's easier and faster than a re-install from scratch.) And, I have had plenty of hard drives die, some with sudden death like now you see it now you don't.

ADDED: And, it should work for your situation.
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 -wayland
Top
Irre
Guru
Guru
Posts: 434
Joined: Sat Nov 09, 2013 10:03 am
Location: Stockholm

  • Quote

Post by Irre » Fri Dec 17, 2021 7:53 am

When I replaced hdd, I simply did i full image backup. Removed hdd and installed ssd, restored from image backup. Last partition was expanded to fill the size of the new ssd. These step were run on linux on an external usb-stick. All systems, Windows inclusive, were succesfully moved to the new ssd. :)
Top
Post Reply

7 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