• A Great friend to the HardForum with a great kid that he is trying to get a scholorship to continue his schooling. Please give hime a vote! Only 24 hours left! Thanks.
    If you have an VOTE FOR KEENAN!

Need some Linux help

Deadjasper

2[H]4U
Joined
Oct 28, 2001
Messages
2,856
I'm trying to recover a Lenovo ix2-NG NAS. I found the instructions but this part makes no sense / does not work.

dd if=/path/to/zImage of=/dev/sdb seek=2048
dd if=/path/to/initrd of=/dev/sdb seek=8192

I don't understand what "/path/to/zImage" means. zImage is located on a USB drive -sbc so it seems to me that the correct syntax would be "/dev/sbc/zImage". This doesn't work, I get a file not found message. If I type it verbatim, something gets copied but It still don't work.

These are the instruction. What the USB drive is supposed to contain when you plug it into the NAS for the second thread is also clear as mud but I'll cross that bridge when I get to it.

The USB drive containing the 2 files about is sdc
The target drive is sba

Just need the proper syntax to make this work.

Instructions are here -

Install firmware on a fresh disk (EZ Media & ix2-ng) - NAS-Central Iomega Wiki
 
Ok so If I'm reading this right you extracted the 2 files "zImage" and "initrd" to a usb drive (root directory), and you have a 2nd USB drive to image them to.
The 2nd USB drive is formatted as "fat" (not fat32), and is at least 1Gb in size.
Now your going to plug both USB drives into a linux PC so that you can use the DD command to image that 2nd flash drive.
Once both drives are plugged in verify you know the names of the drives. in a terminal "sudo fdisk -l" (no quotes)
so now you do the command(s):
dd if=/dev/sdb1/zImage of=/dev/sdc seek=2048
^ in that example SDB1 is the flash drive containing the source files, and SDC is the flash drive you are burning the files to.

One thing to note, you don't need 2 flash drives. you can save those 2 files your linux desktop and path them from there.
eg: say you put them in a folder called iomega on your linux desktop, and after running the fdisk command you determined your hard drive was SDA1 and the fllash drive was SDB
the command would be dd if=/dev/sda1/home/username/iomega/zImage of=/dev/sdb seek=2048

hopefully this is correct. I'm doing it from memory. :D
 
Wow, I was way off. I was dd'ing the files to the hard drive that's going into the NAS. I didn't read anything about a second USB Drive. Somehow this makes sense tho, boot off the second USB drive and it takes care of the Hsrd drive. I'm off to test. Thanks.
 
Ok after re-reading the directions, I think you are correct. you need to image those files to the NAS disk which you took out of the NAS and connected to your linux pc. when that's done you "Put the disk in the nas, plugin the stick, power it up,"

I'm not sure what software goes on the flash drive when you first boot because it sounds like it expects the flash drive to boot and "initialize the data volume". The directions are pretty vague.
 
Yea, I had the same question about the flash drive. Think I'm gonna give it a rest and try some more tomorrow. I hate when I get obsessed with something like this. I know it can be done but finding the right info is tough. To make maters worst, there are more than one model of the ix2 and apparently one or more have something to do with Iomega.

Appreciate the help and I'll report back tomorrow.
 
Still lost. I just can't get my head around the concept of copying these two files to the HD without naming them. If they are both in the same folder, how the hell does dd know which one to copy? I also don't know what's supposed to be on the flash drive you plug into the nas to get it going. Has anyone out there ever done this before? Please???
 
Ok first did you extract the necessary files first? So in a terminal window you'd do the following
Code:
unzip ix2-ng-4.0.2.9960-recovery.zip
now use the cd command to find the zImage and initrd files. According to that web page you linked to it should be extracted from that.
so lets assume you are in your home directory in linux and that is where you extracted it and it's in the ix2-ng directory (I don't have the zip so I am making it up you'll have to find it yourself)
Code:
dd if=/home/yourusername/ix2-ng/zImage of=/dev/sdc seek=2048
and similarly to the above for initrd.

Ok now here is the problem. You ABSOLUTELY must be sure of what disk drive to write to before you do this or you may lose any and all data on the NAS. The outfile that dd will write to will write the data at the lowest level. It doesn't care or know about what is there presently it will just write it as is right to those blocks of data starting at 2048 blocks from the beginning of the disk. Most firmware images and are made as complete disk images and written exactly the same on every device. So when rather than mucking around copying files etc and having files change their locations, this method just replaces the data directly on the disk because they positioned the original files in that particular spot on the drive when they made it. You are basically overwriting the old file's data this way and not touching anything else.

Also worth noting you might need root access to do any of this so you'll need to sudo or login as root to do this.
 
Last edited:
Thanks. :)

The problem I'm running into is dd will not accept the file name (zImage and Initrd) I get an error when I use a command like -

dd if=/home/yourusername/ix2-ng/zImage of=/dev/sdc seek=2048

If I do "dd if=/dev/sda of=/dev/sdc seek=2048" something happens and I don't get any error messages but nothing shows up on the disk. But the formatting is wiped out. The real problem is all I have to deal with here are step by step instructions (and more than one set). what I really need is an explanation of each step and what the end result is supposed to be. All the step by step instructions out there are highly ambiguous to sway the least and lead to more questions than answers. For example, using the command above, how does dd know which file is to be copied to 2048? :(
 
Still lost. I just can't get my head around the concept of copying these two files to the HD without naming them.
Don't think of "DD" as a regular file copy, its more like your burning an image. you can DD a linux iso onto a dvd and when finished the dvd is complete and bootable. So with that line of thinking, when you DD your zImage, its writing some type of data format onto the HDD, and not necessarily just "copying a file". with the seek command it must be specifying which blocks to write it to.

If they are both in the same folder, how the hell does dd know which one to copy?
Your telling it which file to copy. In this case your telling it to copy the file "zImage" (It has no file extension, ie .exe).

I also don't know what's supposed to be on the flash drive you plug into the nas to get it going. Has anyone out there ever done this before? Please???
I think I found the answer here. see step #3. General NAS-Central Forums • View topic - Iomega ix2-dl - how to replace drives
 
You cannot access files in a manner like "/dev/sbc/zImage". /dev/sdX are block devices.

You have to mount a filesystem to access files.

When you plug your USB drive in, the drive should automatically mount somewhere if you're using a non-retarded form of Linux. This could be in the /media or /mnt directory of your running Linux system. It's actually easiest to find the USB drive mount location using the file explorer or disk utility. When you find the USB drive you can find the full path to your zImage and initrd files. So it may be something like /media/USB/zImage. And that's what you'll use for your in file to dd.
 
Yeah. This reads like a 2 part copy job with the same source file, so it's a bit confusing to read.

Here's how I read it -
Part 1:
Download and extract the file linked in the wiki page.
Get a fat32 formatted Flash drive.
0VCTcVO.png


Copy this file to a Flash drive. Now set the flash drive aside. It is done/ready.

Part 2:
This interacts with the HDD from the NAS.

Extract the contents of the imager.tgz file
08btkv0.png


XmYchRX.png


Then from terminal navigate to where you extracted the files and run the dd commands.

Code:
chameleon:~/nasimage/emctools/ix2-ng_images> sudo dd if=zImage of=/dev/sde seek=2048
5749+1 records in
5749+1 records out
2943504 bytes (2.9 MB, 2.8 MiB) copied, 1.0818 s, 2.7 MB/s
chameleon:~/nasimage/emctools/ix2-ng_images> sudo dd if=initrd of=/dev/sde seek=8192
5536+1 records in
5536+1 records out
2834433 bytes (2.8 MB, 2.7 MiB) copied, 0.909782 s, 3.1 MB/s
chameleon:~/nasimage/emctools/ix2-ng_images>

What happens is that dd is writing the contents of zImage to certain sectors of the disk (start location specified by the seek parameter), and then initrd further out so the contents don't overwrite eachother. I'm guessing the result (hopefully) being that the NAS will bootstrap into recovery from just zImage and initrd's contents and then restore the rest from the flashdrive.
 
Thanks. :)

The problem I'm running into is dd will not accept the file name (zImage and Initrd) I get an error when I use a command like -

dd if=/home/yourusername/ix2-ng/zImage of=/dev/sdc seek=2048

If I do "dd if=/dev/sda of=/dev/sdc seek=2048" something happens and I don't get any error messages but nothing shows up on the disk. But the formatting is wiped out. The real problem is all I have to deal with here are step by step instructions (and more than one set). what I really need is an explanation of each step and what the end result is supposed to be. All the step by step instructions out there are highly ambiguous to sway the least and lead to more questions than answers. For example, using the command above, how does dd know which file is to be copied to 2048? :(
Though I don't own that NAS, follow FroBozz's post above, it looks right.

BUT did you actually do that command above? "dd if=/dev/sda of=/dev/sdc seek=2048" :eek: ? Cause if you did then it basically cloned your /dev/sda drive to /dev/sdc but pushed the data it copied 2048 blocks. Basically a chunk of data got overwritten on /dev/sdc the size of the /dev/sda device if you let dd finish to the end.
 
Yeah. This reads like a 2 part copy job with the same source file, so it's a bit confusing to read.

Here's how I read it -
Part 1:
Download and extract the file linked in the wiki page.
Get a fat32 formatted Flash drive.
0VCTcVO.png


Copy this file to a Flash drive. Now set the flash drive aside. It is done/ready.

Part 2:
This interacts with the HDD from the NAS.

Extract the contents of the imager.tgz file
08btkv0.png


XmYchRX.png


Then from terminal navigate to where you extracted the files and run the dd commands.

Code:
chameleon:~/nasimage/emctools/ix2-ng_images> sudo dd if=zImage of=/dev/sde seek=2048
5749+1 records in
5749+1 records out
2943504 bytes (2.9 MB, 2.8 MiB) copied, 1.0818 s, 2.7 MB/s
chameleon:~/nasimage/emctools/ix2-ng_images> sudo dd if=initrd of=/dev/sde seek=8192
5536+1 records in
5536+1 records out
2834433 bytes (2.8 MB, 2.7 MiB) copied, 0.909782 s, 3.1 MB/s
chameleon:~/nasimage/emctools/ix2-ng_images>

What happens is that dd is writing the contents of zImage to certain sectors of the disk (start location specified by the seek parameter), and then initrd further out so the contents don't overwrite eachother. I'm guessing the result (hopefully) being that the NAS will bootstrap into recovery from just zImage and initrd's contents and then restore the rest from the flashdrive.

Thank you sir. This is of immense help. I'll be back at it this afternoon and report back.

Mucho thanks to everyone who has responded, you guys are the best.
 
Back
Top