Backing up thumbdrive not working..

Status
Not open for further replies.

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
So my FreeNAS server has been running for a few weeks. I decided that I wanted to make a backup of the USB thumbdrive since I had to manually install some .ko files and I want to have a simple recovery in case my USB stick fails. Backing up the config file doesn't help me a whole lot if I can't use my network card or hard drive controller because I have to install the .ko files to access those devices.

So I installed Ubuntu in VMWare and did a copy using the dd command. Basically I shutdown the server, put the USB key in the virtual Ubuntu machine and use this command:

sudo dd if=/dev/sdb conv=sync,noerror bs=64k | gzip -c > /home/user/Desktop/(Today's date).gz

I end up with a 150MB .gz file. Sweet!

Then I restore the thumbdrive to a new thumbdrive to prove that my backup works fine by running this command:

sudo gunzip -c /home/matthew/Desktop/(Date for recovery).gz | sudo dd of=/dev/sdb conv=sync,noerror bs=64K

I know I have 2 sudos. I got an access denied error mentioning /dev/sdb so adding sudo fixed it. No idea if there is a more elegant way but it seemed to work.

Then I plugged the "new" thumbdrive into the server and it starts to boot but then stops with an error about freenasS3(or something very similar). So I plugged in the original thumbdrive and it doesn't work either.

Can anyone explain what I am doing wrong? I successfully made a copy once before using the dd command. I'm confused as to what is wrong. I didn't mount the drive, but it may be auto-mounting in Ubuntu. I don't know how to check if it is mounted or dismount it if I need to(or if it would even matter).

I do get 2 errors every time I plug in the original usb drive. It mentions that the superblocks may be corrupt. I just click OK and ignore them. But I'm sure they aren't corrupt because if I hadn't done a backup in Ubuntu the drive always works perfectly. I do not run a fschk or try to access the thumbdrive in any way and simply run the above commands. Is this because I'm using Ubuntu instead of a FreeBSD system? Is this because I'm doing this in a virtual machine? Am I being too anal by trying to make a backup of my USB stick? I'm hoping to understand the cause for the problem as well as a possible solution.

Thanks!
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Am I being too anal by trying to make a backup of my USB stick? I'm hoping to understand the cause for the problem as well as a possible solution.

Thanks!

Noob,

I hope you understand the frustration in this reply because this topic has been repeatedly covered. Don't clone FreeNAS USB drives!

YES, you're being too anal... How much time have you wasted trying to clone the stupid drive when you could:

1) Save your config
2) Save your kernel, or any other tweaked file(s)
3) Create a new drive
4) Boot it up, copy the files to it
5) You're done!

It would take maybe 5 minutes?!

I've seen more whining about not being able to clone a USB stick than any effort to do it the easy way!

Create a Cron script to tar & copy the tweaked files....
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Haha. I read several other posts where people said to use DD to make the copy, some said to use Acronis, and still a few others that said don't try to clone it. In fact, I had found the FAQ where the question was asked how to clone your thumbdrive (http://doc.freenas.org/index.php/FAQs). There was no answer in the FAQ.

So I guess I won't try to do the cloning. I just thought it would be easier if I built a freenas server for a friend and then moved out of state he could do a recovery on his own.

So on a technical note, can you explain a little why cloning the disk as I tried to do doesn't work? I'm thirsty for knowledge and curiosity will kill me. If it's a long drawn out explanation a link or two is fine. I'll enjoy figuring it out. :)

Question: If I wanted to help maintain the FAQ how would I go about doing that? I know that presently I wouldn't try to answer questions, but I'm thinking a year from now I'll probably be able to help out with guides, manuals, and answering questions in the forum. Being unemployed gives me PLENTY of time to goof off with Freenas and breaking(then fixing) things in it and learning lots on the way....

Edit: Honestly, I think the cloning thing comes from the poor saps that are used to backing up Windows by cloning the partition(I'm a part of this group). The thought process is probably something like "Surely, if it's good enough for Windows then it MUST be good enough for any other OS..." LOL.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Haha. I read several other posts where people said to use DD to make the copy, some said to use Acronis, and still a few others that said don't try to clone it. In fact, I had found the FAQ where the question was asked how to clone your thumbdrive (http://doc.freenas.org/index.php/FAQs). There was no answer in the FAQ.

So I guess I won't try to do the cloning. I just thought it would be easier if I built a freenas server for a friend and then moved out of state he could do a recovery on his own.

So on a technical note, can you explain a little why cloning the disk as I tried to do doesn't work? I'm thirsty for knowledge and curiosity will kill me. If it's a long drawn out explanation a link or two is fine. I'll enjoy figuring it out. :)

I don't understand it well enough myself, only that it doesn't work reliably. I think flash drives tend to map sectors strangely and the boot sector doesn't end up in the right place or the bootable property doesn't get transferred when you clone.

Question: If I wanted to help maintain the FAQ how would I go about doing that? I know that presently I wouldn't try to answer questions, but I'm thinking a year from now I'll probably be able to help out with guides, manuals, and answering questions in the forum. Being unemployed gives me PLENTY of time to goof off with Freenas and breaking(then fixing) things in it and learning lots on the way....

The Official FAQ and documentation is a Wiki, so anyone is free to add stuff, but... Be forewarned, Dru, one of our helpful admins and author of several FreeBSD/PC-BSD books, is the queen of the documentation. I'm sure she appreciates any help, but it will likely be heavily edited or removed if it doesn't meet certain standards. It's also a lot of work keeping answers updated and adding new stuff. The forums are a goldmine of material for finding answers and new questions for the FAQ. If only people would search/read stuff more before burying the answers with the same questions.

Anyway, reading as many posts as possible regardless of poorly chosen titles is a good thing. If you're bored, helping to add proper single word tags to threads that have been solved or provide clear details about something is helpful too. Don't be afraid to try and answer questions, sometimes they're easier to answer than the title makes them sound and it's a good way to learn.

Edit: Honestly, I think the cloning thing comes from the poor saps that are used to backing up Windows by cloning the partition(I'm a part of this group). The thought process is probably something like "Surely, if it's good enough for Windows then it MUST be good enough for any other OS..." LOL.


I think a lot of people think a whole bunch of stuff gets updated on their USB and also don't want to remember what changes they might have made, so cloning is the answer to avoid thinking.

Anyway, welcome to the FreeNAS 8 Forums!
 

juned

Cadet
Joined
Dec 8, 2013
Messages
1
Hello all. I have a very similar issue. I cant even boot into Freenas any more and the USB finally died so I cant save the Config file. Is it better for me to re install Freenas 9 ( I was using 8.2) and re import my volumes. I only have 2 users and 4 TG of data. TV eps and so on. I just cant be F@@ked doing hard work at this hour of the morning. Otherwise I might have to do it on a day off. Is there a way to copy USB Sticks????? Or am I just wasting my time with that option?

All help appreciated..


June
 

gpsguy

Active Member
Joined
Jan 22, 2012
Messages
4,472
June, I'd do a fresh install of 8.3.2 and try to get FreeNAS running again. Then think about 9.x

While you can't boot your USB anymore, you might be able to rescue the configuration file from it. See the information from Dusan and I, in this thread.
 

Knowltey

Patron
Joined
Jul 21, 2013
Messages
430
Hello all. I have a very similar issue. I cant even boot into Freenas any more and the USB finally died so I cant save the Config file. Is it better for me to re install Freenas 9 ( I was using 8.2) and re import my volumes. I only have 2 users and 4 TG of data. TV eps and so on. I just cant be F@@ked doing hard work at this hour of the morning. Otherwise I might have to do it on a day off. Is there a way to copy USB Sticks????? Or am I just wasting my time with that option?

All help appreciated..


June

You necro'd a nearly 2 year old thread.... That said.

If the USB is dead how would copying it even work in the first place? If you don't have any configs saved you'll probably just have to reinstall and reconfigure manually. Most the hard work with datasets and the pool should be automated by a pool import though. Users, plugins, etcetera though you'll just have to remember how you had them set up and/or figure it out again.
 
Status
Not open for further replies.
Top