0.5 BTC reward for anyone who can post exact instructions on how to do this (that actually work). I've tried myself, but I can't get it to work.
I have a fresh Ubuntu 11.04 install on a harddrive with everything setup for headless mining (used
this guide). When I installed Ubuntu, I made sure to put it all on one single partition that is less than 8GB (the size of the USB thumb drive). I have no swap and I have also enabled tmpfs (for /tmp) and added noatime to fstab to reduce writes to the USB drive (once its moved over).
Now I would like to clone this partition over to the USB thumb drive, remove the harddrive and just have the rig boot off the thumb drive.
If I understand things correctly, I need to:
1. Boot from a Live CD (or a second USB thumb drive in my case).
2. Clone the partition from the harddrive to the target thumb drive (using dd).
3. Somehow make the computer boot of the thumb drive.
I think I've managed step 1 and 2, but I have no idea how to tackle step 3. I'm guessing I need to install a boot loader on the thumb drive, but this is where my Linux skills fall flat.
Anyone?
This is how I clone USB sticks, should work the same and, depending on the PC and USB stick, it should take about 10 mins for 8GB:
1) Put your empty USB stick in a usb port, then issue a
Code:
dmesg
you should see something like:
Code:
[38443.728018] usb 3-4: new high speed USB device number 3 using ehci_hcd
[38443.863492] usb 3-4: New USB device found, idVendor=0951, idProduct=1624
[38443.863496] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[38443.863498] usb 3-4: Product: DataTraveler G2
[38443.863500] usb 3-4: Manufacturer: Kingston
[38443.863501] usb 3-4: SerialNumber: 0013729B6EB8E9616000002A
[38443.863978] scsi15 : usb-storage 3-4:1.0
[38444.893201] scsi 15:0:0:0: Direct-Access Kingston DataTraveler G2 PMAP PQ: 0 ANSI: 0 CCS
[38444.894329] sd 15:0:0:0: Attached scsi generic sg2 type 0
[38445.626356] sd 15:0:0:0: [sdb] 15679488 512-byte logical blocks: (8.02 GB/7.47 GiB)[38445.626847] sd 15:0:0:0: [sdb] Write Protect is off
[38445.626850] sd 15:0:0:0: [sdb] Mode Sense: 23 00 00 00
[38445.626852] sd 15:0:0:0: [sdb] Assuming drive cache: write through
[38445.630964] sd 15:0:0:0: [sdb] Assuming drive cache: write through
[38445.654546] sdb: unknown partition table
[38445.657168] sd 15:0:0:0: [sdb] Assuming drive cache: write through
[38445.657173] sd 15:0:0:0: [sdb] Attached SCSI removable disk
Here I've just inserted a Kingston 8Gb USB stick, note the name it gets in the line where it tells you the size
Code:
[38445.626356] sd 15:0:0:0:
[sdb] 15679488 512-byte logical blocks: (8.02 GB/7.47 GiB)
So its name is sdb.
With a mount command you can verify that your corrent USB stick (the one you booted from) is not sdb,
Code:
mount
Code:
/dev/sda1 on /live/image type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8,shortname=mixed,errors=remount-ro)
/dev/sda2 on /live/cow type ext4 (rw,noatime,user_xattr,acl,barrier=1,data=ordered)
look for the lines that contain /live/image and /live/cow.
then, to do the copy
Code:
dd if=/dev/sda of=/dev/sdb bs=64K
which calls dd and gives it the input file (on linux everything is a file, even a disk) the if=, the output file of= and a block size bs= to make it go faster otherwise it does a sector by sector copy (512 bytes) and so it can take a fairly longer time.
PAY ATTENTION
If you make a mistake and put as output file your current USB stick (the one you booted from) you will erase it!! Be careful.
If it works for you, please send donation here: 197kuoutCZN4zFfou7Jrm8eRJ6En9nbQrB