Migrating to a Larger Disk with Rémy

EthStaker Workshops and Technical Guides · January 2021 · 23:55

Rémy walks through migrating an Ethereum node to a larger disk, in a session from EthStaker's Workshops and Technical Guides series. An execution client's database grows continuously as the chain expands, so node operators and validators periodically need to move their setup to larger storage without extended downtime that could cost a validator its uptime-based rewards.

Topics

From EthStaker Workshops and Technical Guides, hosted by Eth Staker.

Transcript

Intro

hello everyone my name is Remy I work with the eaker community and today I'm going to show you how you can migrate to a larger dis if you are an ethereum validator so let's jump uh right away into it we will uh check out uh first one of my guide um that I wrote about this which I'm going to also Link in the description below uh where you can get um all this information and and even more on how to do this today I'm going to going be using a test machine that I just synced on Main net as well so we will show you guys how to do this migration and how you can check on your current thisk

space and uh what are the potential alternative to migrating to a larger dis so let's get started with my machine here so I'm connected remotely on on this Mini PC um and you can see here here this is um on Ubuntu um so one of the first thing that you can use um to check on your dis space first of all is DF DH which is going to show you all your file system and in this example here you can see that the main um file system is this one here Dev um SL mapper SLB to something it's

Current disk usage

currently using almost one gigabyte uh one terabyte of disk space um and it still has a long way to go before it's um fully used it it's only using um 56% of the dis right now this is running GE with PB uh pbss and Lighthouse which are are two great client um especially G on the execution side um um um for um disk space um usage um another command that you can run to check on your disk bace which I love is a tool called ncdu

um it's a tool that you can use to explore uh which of your directories are using the most uh space so in this case since this is like a dedicated device running on Main net um the main directories that are going to be using space on thisk machines are going to be the ones for G and its database and and for Lighthouse so let's just run the command ncdu um dx- Q um and then slash to check out from the root directory and you can see this is like an example of what you will get when you run this tool and you can interactively browse into the

different um subdirectory so let's let's go and check out on the VAR and lib sub directory I know this is where I configured my clients to store their data and you can see in this example um on a fully synced node um a recent fully sync node using geff and Lighthouse that like geff is using about 924 uh 7 gigabyte of uh disk space and I house uh almost like 40 gigabyte of dis space so this is what you can expect on um February 2024 um as you know as you keep running these nodes uh more transactions and

more states are being stored on the blockchain and those States needs to be stored somewhere and in many case the node operators are the ones storing um these states so it grows over time and like there's different ways to um manage this um like this growth um of space um but these are some of the like commands that you can run to check on your um dis space another one that I like um is um add this I believe if I check here it's with Dash l so f disk with an dashell um will give

you a list of your uh dis and their partition so in this instances here I'm using a Samsung SSD 980 uh 2 tbte and and you can see it's currently using like three partitions um and those ones were also shown with the DF command and you can see like the the main partition is this one here the n V Me 0 and 1 P3 um which is almost like two terabyte um big uh but the other ones are like

for the boot system so like this is using like the default option when I installed the U 220 um 04 so those are the same the simple like your dis space um before um trying to migrate to a um larger dis you should know like there's a bunch of different option that you can take um pruning um is one of them so many clients will accumulate unneeded um data over time and pruning is like a process that you can use to just remove this junk um over

Alternatives to migrating

time um some clients have a manual pring process um other like I might have options to do this automatically um so this is a great way to manage your disk usage updating and resyncing from scratch is a great options for for some client um as client improve um on their strategy to store their data they often have like new ways to to use databases and then if you're resing from scratch um you can gain some um Improvement on dis usage there's various configuration you can use um

like a big one for instance is the path Bas storage scheme for PBS um for sorry for GE um so it's pbss um it's like in a recent way um or a recent option that you have added um to use less this space um if you want to start using this configuration option you'll have to resing from scratch but it gives you some very important um dis usage uh improvements and like various clients will have different options so you should consult your client documentation about this um migrating to a different client can be an option um as of today

uh G with uh pbss is like one of the most dis efficient um way to store the execution data uh for your node U but you should also know that gef is currently like a majority client on the execution layer and there's a few um cons that you should be aware like it pose a significant risk to your own um stake if you're using the node for staking and it's also not that healthy for the whole um Network so there's pros and cons that you will will have to think about if you want to go that route using multiple disc is another option um instead of like

migrating to a larger dis um if your system was configured um in a way to enable extending your partition easily such as with um lvm um it could be an option also um if you have enough room in your machine um many mini PCS or KNX don't have like that many SSD slot for instance so it might be harder if that's um those kinds of machines that you using um but it all it can be a very interesting option as well um adding monitoring and all for your disk usage is also a good practice so just so you know this is a good way

to do it so let's switch to migrating to a larger dis and actually do um one for this test machine that I'm using right now the general idea to migrate to a larger dis is quite simple um you stop your known machine um you plug both disc into the same machine um it could be the machine you're using for saking or it could be another one you boot into a liveos or a tool to perform the copy you extend your volumes your partitions and your file system on the larger desk in order to be able to use the full capacity and then you plug the larger disc back into your sticking or node um machine and you

restart it that's pretty much it and um we'll show you how to do it to start I will prepare a bootable USB disc um to boot on with the tools that I need to perform the this clone or the this copy um in this case I'm going to be using Clonezilla Clonezilla is a great tool to do this and I'm going to be using Rufus um to create the bootable um use Beast just before I'm I'm going to show you the clona website so you will need to download the live version of Colona um so this is their website currently um I suggest you select the stable version and then in here um I suggest you download the ISO file type make sure to keep the CPU architecture to

Preparing your bootable USB stick

amd64 and then click download to download this uh for Rus if you're on Windows this is a great tool to create bootable USB um drives um it's it's very simple to to use you can download various version down here and I'm going to show you how to I'm back here in my download folders with all the tools that I need to create a bootable USB stick I'll start Roofus I've already plugged the USB stick into my machine here so I can select it here if you have multiple they will show here you have to select the iso image so let me just select it here I'll select Clon Zilla live and then all I have to do now is click

Start um I'll give this um a clone Zilla label just so I know when I plug this USB stick um you can use the recommended option here nothing special about that and then you'll just have to wait until this is all done and we're done with creating the bootable USB S I can just C close here so my machine is still running my sticking machine here so I will just um stop the machine um plug both um SSD um on that machine I'll plug the USB stick as well and come back to show you how I

can boot on the USB stick we're back here and I'm rebooting my machine um I'm holding Escape um in order to access the boot menu I'm going to go into the boot here um option and you can see that I plugged in like my U USB adapter um in my um USB stick the USB adapter is is simply for me to connect um my larger dis um this Mini PC only has like one slot for an mvme SSD so I bought like this let me show you here this one here um it's not showing great on screen here but this is like a USB adapter

Selecting the boot device

um type c uh for nvme dis so I can add the the the the new dis on that machine and I bought this this new disc here a 4 tbte this so I can do the the cloning and show you guys how this is performed but in order to build on this machine I will be using um the USB stick here which is um this uh this um boot device here um it's the send disk um dis that's only like 16 gigabyte um big so let me click enter um save configuration to and since this is loading from a USB stick it might take just a few second for the

Using Clonezilla

whole operating system to load um so just wait now I can select my language let's keep it in English um keyboard layout is fine uh we will start the Clon Zilla text base user interface here um if you are very Advanced you can use the command line prompt but since this is more a of a beginner guys let's uh use the text based user interface here in order to clone from a a disc to another dis I will select the device to device um mode

here is currently looking for all the dis um that are connected to this machine and eventually um I'll be able to keep going now I'll select the beginner mode here um if you're through the expert if you know what you're doing um there's a bunch of advanced options that you can select here um I won't go through any of these options but beginner should work for most people I want to copy a full dis like a I want to do a full disc clone so the first option here is the one that I have to select at this step I have to select the source dis so if you look at the description like it's kind of hard to see but like the The Source disc is my Samsung SSD

980 um 2 terab so I know that's like the smaller disc that I have and like the bigger one is going to be like the 4,000 gigabyte um dis so I can select the first one as the source one and I'll be prompted to select the target one here so I want to select the the bigger one to migrate from the smaller one to the bigger one at this step you can select just to skip checking repairing the source file system um this step is quite important here um if you want to have Clonezilla um just um expand the partitions on the target machine uh not the target machine

but the T the target disc um I suggest you select the dash um K1 option here which will simply create partition tables that are proportional to the new uh disk size um so I don't know if you remember when we checked on the uh partitions that I had on my original desk those are three ones um and the main one was was like almost 2 terab large um so this will simply expand that partition automatically to use um like double the amount of space right which is exactly what we want

here and as a last option here you can select what you want um consola to do when um it's done with all of its task um so like you can select shut down it'll just shut the machine down or you can select to uh prompt you to um ask you like what you want to do when all of this is finished so let me just select this option here so I can show you the full progress of the tool I'll be prompted to confirm a bunch of stuff so let me just do that and um eventually we will'll be able to um show you the progress of

Disk cloning

dialog all right so Clonezilla started to clone the different partition it's already done with the first one since that was like a smaller one this is the second partition which is only two gigabyte large which should be which should be like very fast now we are going to start on the third one which is like the main and largest one which is going to take a few minutes or hours you can see that my transfer rate at this point is around 25 GB per minute and Killa will show

you an estimated remaining time um as of now you can see it's still fluctuating but as of now it's showing that it'll take around 1 hour and 35 minutes we'll come back once this is like closer towards the end of the disc clone a few moments later hey we are back and we are mostly

done with the cloning process as you can see it almost took 2 hours to clone this 2 terab Disc onto a 4 terabyte 1 if you remember we told Clonezilla to ask us what to do next I believe it's simply doing a few checkup now and we will simply ask um conzilla to shut down the system all right everything's mostly

done let us um continue here and we will power off the system now I will uh switch the dis as remember this is my um Mini PC and I will simply remove the 2 terby disk and put the 4 tby One hey I'm back in my machine is mostly working so I switched the smaller SSD I put the bigger one or the larger one back into the machine and I rebooted um and everything is working fine now there's something that I'm missing right so if I check on the

Fixing the LVM volumes and filesystem

current disk space usage you can see that I still only have like 1.8 thte of available space even though I'm now using my bigger um dis and I can confirm this by just calling Fisk DL and you'll see now that I'm running on this new um 4 terte SSD uh the partition is good like it was expanded um however since I'm using lvm I only need to perform a few task to expand the um lvm structure so lvm uses uh physical groups

physical volumes and logical volumes and in order to be able to use the additional space created by this um new SSD I will have to expand my physical volume my logical volume and the underlying um file system and there's two easy common that you can use which are PV resize and LV extend but first I need to find out the path of those physical volumes and logical volumes and there's a quick command it's this one here which you can call to find out so let's call this

one so my physical volume is um path is this one and the logical volume path is this one right so let's start with the PV resize to resize my physical volume there you go and in order to extend my logical volume I have to call this command here so we can simply copy and paste the command with the logical volume path so let me go ahead and copy that path here there you go should be very quick and then once

you're done you can confirm that my available disk space or dis size on my main volume or file system here went up to um 4 terabyte or so like depending on how you format it right and I'm pretty much done um like my client restarted automatically everything's working as intended um and now I have more space to um handle these additional um states that needs to be store so what else um should I be doing next what what is there remaining here

um nothing much really I could decide to wipe clean my other um smaller SSD especially if you're a sticking node um and you still have your validator keys on that other smaller disc which is right over here it's this small disc here um you should strongly considered uh wiping um this this simply to make sure you're not running both of your keys at the same times right for instance if you were to plug this one in a new disc and boot on it by accident um running the same validator Keys twice at the same time um might cause a slashing event um in which case you would lose um

some money right so thanks for watching I hope you learn something and um I'll see you again in a uh other video bye-bye