Community discussions

MUM Europe 2020
 
jgro
newbie
Topic Author
Posts: 48
Joined: Sat Jun 10, 2017 7:33 am

Procedure for replacing SD card?

Sun Dec 01, 2019 1:33 pm

I have an SD card (Transcend 16GB High Endurance TS16GUSDHC10V) in my hEX RB750Gr3 that I am using to store logs and the dude database and everything else I can have on it rather than the internal flash drive.

I want to replace the SD card before it wears out (side note, is there any way to check on how close it is to being worn out?), but I do not want to lose any data. However, I don't see any way to do that. Obviously I can replace the card, but then it will be a new, blank card, and even if the dude and the logger and scripts will still write to it, they will not pick up where they left off and append data, they will start over.

I don't readily have access to any other device that supports ext3 format or microSD cards. Is there some way for me to clone the SD card (maybe tar or something) over ssh and then restore it to the new card without things getting corrupted during the restore? Among other things, I'm worried that if I have to restore the data to the new SD card while the hEX is running, something will get corrupted as hEX continues to write to files while they are being restored.
Last edited by jgro on Mon Dec 02, 2019 2:05 am, edited 1 time in total.
 
Sob
Forum Guru
Forum Guru
Posts: 4887
Joined: Mon Apr 20, 2009 9:11 pm

Re: Procedure for replacing SD card?

Sun Dec 01, 2019 7:29 pm

First idea that comes to mind is to not insist on "while the hEX is running" part. Turn it off, remove the card, use something to clone it, put the new one in, turn it back on.

How could it even work without powering it off? Even if you could make a backup and write it to new card while hEX would still use the old one, you'd have consistency problems, because when you'd swap the card, changes that happened since the backup was made would be missing from new card. Plus there would always be at least short while when router wouldn't have any card inserted, and what if it needed to write or read something?
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply.
 
jgro
newbie
Topic Author
Posts: 48
Joined: Sat Jun 10, 2017 7:33 am

Re: Procedure for replacing SD card?

Mon Dec 02, 2019 2:03 am

First idea that comes to mind is to not insist on "while the hEX is running" part. Turn it off, remove the card, use something to clone it, put the new one in, turn it back on.
If I could do that, I would not have said "I don't readily have access to any other device that supports ext3 format or microSD cards."
Even if you could make a backup and write it to new card while hEX would still use the old one, you'd have consistency problems, because when you'd swap the card, changes that happened since the backup was made would be missing from new card.
I can live with missing out on the changes that happen during the time it takes to clone the card, so long as the cloned card remains viable. If the cloned card is corrupted because it contains, say, an update of a database table file but no the corresponding update of the database index file, then that's no good.
 
Sob
Forum Guru
Forum Guru
Posts: 4887
Joined: Mon Apr 20, 2009 9:11 pm

Re: Procedure for replacing SD card?

Mon Dec 02, 2019 3:03 am

What about computer and microSD reader connected to USB? Those things are not exactly rare. And you shouldn't need any specific support for ext3, read the card as full image and write it the same way.

But if that's really not possible, you should stop processes that are using the card (disable Dude, ...), then copy files elsewhere, replace card, copy them back, and restart everything. That should probably work.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply.
 
whatever
Member Candidate
Member Candidate
Posts: 112
Joined: Thu Jun 21, 2018 9:29 pm

Re: Procedure for replacing SD card?

Mon Dec 02, 2019 4:02 pm

I don't readily have access to any other device that supports ext3 format or microSD cards.
You don't have a PC? Unlikely.
You don't have a microSD reader? There are very cheap USB devices.
You don't use Linux on your PC? Boot a live Linux from USB stick.

Once you have everything in place: Use dd to clone the card. If the new card is the same size as the old one, you are done, If the new card is larger use fdisk and resize2fs to grow partition and filesystem, otherwise the additional space will not be available.

Who is online

Users browsing this forum: Google [Bot] and 55 guests