Highlighted
Absent Member.
Absent Member.
1374 views

Imaging from USB stick

Hello All,

I'm working on getting a USB thumb drive to use for imaging. We're not doing PXE here, and in the past, have used imaging CDs to pull the images from the server. We have a lot of broken CD drives because of the kids(K-12 School), so a USB stick would be a great work around.

At this point, I have the USB drive all set up:

-it boots linux properly
-loads settings.txt
-calls an imaging script
-nfs mounts a directory on the imaging server
-sources a second script from that nfs mount so i can make changes to the script without having to burn new CDs or rip apart the initrd every time we change a script
-it connects to the server and will run the img command

This is where I run into a problem. Since I had to make the USB stick SDA, the Hard Disk becomes SDB. By default, the img -makep will make an image of SDA and put that on the server. When I do an img -restorep, it will bring the image down on top of the USB stick, basically destroying it.

Is there a way to specify which drive you want the image to be created from and conversely, which image to bring an image down onto? I didn't see anything in the docs, but to be honest, they're frustrating to navigate so I might have been looking in the wrong spot.

Thanks in advance.

Labels (2)
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

Re: Imaging from USB stick

Hello,

Have you tried with img restorep PathImage -ap=advanced option.

Regards
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Imaging from USB stick

carfra1;1990797 wrote:
Hello,

Have you tried with img restorep PathImage -ap=advanced option.

Regards


Thanks for the response. I'm not fully understanding the -ap option in regards to my issue. How do you specify what the local partition(or disk?) is? Even if I used the -ap switch, I feel like bringing an image down to the machine will just kill the USB stick, which is SDA. I want to do operations on SDB.

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Imaging from USB stick

Sorry but I don't know how to resolve your problem, here you have a copy/paste of the documentation about the "-ap advanced opiton" to restore an image:

I hope it will be useful

-ap=partition:partition A mapping between a partition in the image archive (apartition) and a target
physical partition on the local machine (ppartition). Use this parameter to
selectively restore a specific part of the image to a specific local partition.
IMPORTANT: If you use this parameter, none of the existing local partitions
are removed, and only the target local partition is updated. The update
process does not remove any existing files; however, any existing files of the
same names are overwritten. If you want to remove all existing files from the
target partition before updating it, first use the Partition Operations Mode to
delete and recreate the partition. If you choose to restore the base image, you
need to delete and recreate the target partition before restoring the image
because your system might be left in an inconsistent state if the Selective
Partition Image restoration fails.
For apartition, use the partition number displayed for the source partition in the
Image Explorer (zmgexp) utility. For ppartition, use the partition number
displayed by img dump for the target partition. The target partition must be a
partition of a supported file system. You can repeat this parameter as needed
to request multiple selective restorations in a single operation. In doing so, you
can apply multiple parts of the image to a single local partition, but you can’t
apply the same part of an image to multiple local partitions in a single
operation.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Imaging from USB stick

Well, I don't know what happened but it just started working. The only variable I can think of it that I had a zen boot disk in the CD drive. Other than that, I can't think of what I changed to make it work. I tried mucking with the -ap switch, but all of my machines have different partition setups from the factory.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.