# nodl OG SSD upgrade
Applies to:
nodl OG
Video tutorial
This video tutorial (opens new window) is hosted on Youtube
# Why Upgrade
Upgrading OG nodl from 500 GB to 1 TB is needed because the blockchain is getting larger than the current SSD can handle and thus will need a larger memory to store it.
# Before you start
Video (0:18 - 01:17) (opens new window)
What you need:
- The original nodl OG 500 GB.
To check the current memory size first you ssh into the device as root ssh root@nodl-name.local
or ssh root@IP-address
if for some reason the DNS name cannot be resolved.
Once in, run df -h
then find /dev/sda3
the size of which should be around 400G.
Philips Screwdriver (any reasonably sized one should do).
A new SSD 1T or more (Samsung 860 EVO is recommended)
USB to SATA adapter
Swiss army knife (or any cutter) to open the box
# Step 1: Plug in the new SSD to your nodl
Video (01:17 - 02:05) (opens new window)
Plug the new ssd into the USB to SATA adapter and one USB port on the back of the device (you dont have to shutdown the device).
# Step 2: Stop all services in the UI so that no data gets written
Video (02:05 - 03:23) (opens new window)
Log in the UI as admin and stop all services until all tiles show "Inactive"
SSH into your nodl as root
ssh root@nodl-name.local
then runservice mysql stop
when you are in.
# Step 3: Identify the new drive
Video (03:23 - 04:17) (opens new window)
- Run
ls /dev/sd*
to list all the devices starting withsd
depending whether you have a backup drive or not the new drive will be either named sdb
(if there is no backup drive) or sdc
(if you have a backup drive plugged in).
- To verify we have the correct name, run:
fdisk -l /dev/sdc
or
fdisk -l /dev/sdb
The correct drive should have above 900 GiB.
NOTE: The rest of the instuctions will assume you have a backup drive plugged in and will use sdc
for the new drive. If the new drive for your nodl is named sdb
you should replace sdc
with sdb
.
# Step 4: Remount the data partition in read-only mode
Video (04:17 - 04:34) (opens new window)
mount -o remount,ro /dev/sda3
mount -o remount,ro /dev/sda1
# Step 5: Copy the data from the old drive to the new one
Video (04:34 - 06:58) (opens new window)
apt-get update
apt-get -y install screen pv
screen
(this will help resume the ssh session if it gets closed)dd if=/dev/sda bs=1M | pv | dd of=/dev/sdc bs=1M
The copying will take about 4 hours. Once copied, the prompt should come back. The SSH session could terminate but since you are running screen
you can return to the session.
# Step 6: Repair and resize the new partition
Video (06:58 - 11:20) (opens new window)
In case your ssh session was closed, SSH back in then run
screen -dr
, this will show the active sessions, the one you want to return to should be the one with the larger number.partprobe
if you get an error, run apt-get -y parted
first
ls /dev/sd*
there should be 3 new items
sdc1
,sdc2
andsdc3
, we want to resizesdc3
.e2fsck -f /dev/sdc3
type yes for all prompts.
fdisk /dev/sdc
Command (m for help): p
Here you verify that you are working on the new drive, it should show the correct size after Disk /dev/sdc
.
You need repartition the last partition sdc3
so that it ends at the end of the drive. To do that you need to repartition the sdc3
partition. Write down the number under Start for the sdc3
parition.
Command (m for help): d
Parition number: 3
Command: n
Select (default p): p
Partion number: 3
First sector: (the number under Start for /dev/sdc3 that you wrote down)
Last sector: (press Enter for the default value)
Do you want to remove the signature?: N
(never answer yes here!)
Command (m for help): (q if you want to quit without enforcing any of the changes, p to print, w if you are ready to write the changes): w
partprobe
resize2fs /dev/sdc3 (or /dev/sdb3)
halt -p
(to safely shutdown the device)