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!
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!