DiskDump to a smaller USB
-
@DustinB3403 said:
So I have to backup it up to an img file first and then write it, is that correct?
Back it up to the img file then consult with someone who knows more man. We're at the bleeding edge of my linux expertise here.
Were it me, I'd take the backup then resize the 32GB usb with gparted then you can use gparted or DD to copy it to the other USB
-
There might be an easier way, but I would dd it to a logical volume, then shrink the logical volume and then dd the volume to the smaller USB.
lvcreate -L 32G -n <name> <volumegroup> dd if=/dev/usbdrive of=/dev/<volumegroup>/<volumename> bs=4M resize2fs /dev/<volumegroup>/<volumename> 16G lvreduce -L 16G /dev/<volumegroup>/<volumename> dd if=/dev/<volumegroup>/<volumename> of=/dev/smallerusbdrive
I would take a backup of the 32 GB usb drive before I did anything. You can just
dd if=/dev/usbdrive of=/home/dustinb3403/usbfile bs=4M
to make sure nothing is lost. -
@johnhooks said:
then shrink the logical volume
How?
Also, what do you mean by a logical volume?
-
@MattSpeller said:
@johnhooks said:
then shrink the logical volume
How?
Also, what do you mean by a logical volume?
A partition.
-
@Dashrender Thank you, I'm going to get a coffee, I'm slow today.
-
@MattSpeller said:
@johnhooks said:
then shrink the logical volume
How?
Also, what do you mean by a logical volume?
I updated my post to show how
-
@johnhooks hero of the thread - thank you, I'm saving that to try at home!
-
@MattSpeller said:
@johnhooks hero of the thread - thank you, I'm saving that to try at home!
Ha don't call me a hero until we are sure it works
And like I said, there might be an easier way to do this but that's the first I thought of.
-
All of that is also assuming you have space left to make a logical volume. I always leave extra room for LVM snapshots and one off scenarios like this.
-
One other thing to watch for. Resize2fs only works with ext file systems. Last I heard you can't shrink an XFS file system, only grow it.
-
I thought of one other way that could possibly work also. You can just copy the MBR on the big USB to the small one to make it bootable with
dd if=/dev/bigusb of=/dev/smallusb bs=512 count=1
then you can just copy the actual files from the big USB to a new partition on the small one. -
BUy a 32gb USB. They are < $20. How much time are you wasting on this?
-
@JaredBusch Thank you Jared, always so wise.
-
@DustinB3403 said:
@JaredBusch Thank you Jared, always so wise.
It is a serious statement man. How much have you cost your company in the pursuit of of this?
-
@JaredBusch None because I've been off for the past few days.
-
@DustinB3403 said:
@JaredBusch None because I've been off for the past few days.
Then why are you giving away your time for free to your company?
My personal time is more valuable than that.
-
I think that it is his person XenServer installation.
-
For me this is a learning experience to even learn if its doable.
I'm doing other stuff as well, not just dicking around with this.
-
$10 and the 3 closest stores to me have them in stock so I bet your closest store would, too.
http://www.officedepot.com/a/products/124999/PNY-Attach-3-32GB-USB-Flash/?cm_mmc=PLA--Google--Data_Storage_Media-_-124999-VQ6-47886868556-VQ16-c-VQ17-pla-VQ18-online-VQ19-124999-VQ20-76860675716-VQ21--VQ22-177839036-VQ27-9203161436&gclid=CjwKEAiA3Ou1BRDso5XyhduuwFASJABP3PEDg3I-OGVYSxiU_IvvxBXhdqt36evzEUS1qj91jvgFHRoCNr3w_wcB
-
@scottalanmiller said:
I think that it is his person XenServer installation.
Even if this is true, that does not mean that time is free. Trying to shoehorn a larger disk into a smaller disk is never a good idea. Yes people try and do it all the time. Still does not make it a good idea.