Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Transfer Gentoo installation from hd to usb-stick
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Pearlseattle
Apprentice
Apprentice


Joined: 04 Oct 2007
Posts: 162
Location: Switzerland

PostPosted: Thu Oct 04, 2007 11:23 am    Post subject: Transfer Gentoo installation from hd to usb-stick Reply with quote

Hello

Well, hello everybody - this is my first post in this forum. Normally I'm active on www.linuxquestions.org, but I wanted to know if there are some particularities concerning Gentoo for the question I have.
A few weeks ago I tried to transfer the Gentoo installation I have on my harddisk (sata) to a USB stick. I created the directories, copied all the files, etc until the usb-key was a mirror of the harddisk, changed the entries in fstab and grub, ensured I had all USB options not compiled as modules but in the kernel itself (2.6.19), rebooted, grub was found, it loaded the kernel and..... it didn't want to find the root filesystem. On the USB stick I created the usual boot partition sdb1 which contains grub and the kernel, and the root partition is sdb2 - probably if the system would boot, those "sdb" would become "sda", right?
Any clue if I have to do something more than that? I was reading here and there and I saw some text speaking about something called "initrd" (not sure anymore it was called like that) concerning delaying the boot, so that the usb stick is correctly recognized and that it can be mounted. Do you think that would solve my problem?
I went through the guide "Gentoo liveusb" <http://www.gentoo.org/doc/en/liveusb.xml>, but that's not what I would like to have (or I didn't understand the article) - I just want the same stuff I have on the HD to be on the USBstick - my kernel, my root filesystem, etc... .
Thanks a lot to everybody...
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Oct 04, 2007 12:41 pm    Post subject: Reply with quote

Code:
cp -ax /mnt/blah1/* /mnt/blah2/

Fix your broken URL links.
Back to top
View user's profile Send private message
merlijn
Apprentice
Apprentice


Joined: 10 Apr 2007
Posts: 161
Location: Den Haag, Holland

PostPosted: Thu Oct 04, 2007 12:45 pm    Post subject: Reply with quote

Hiya,

Most of the stuff you did is just fine. Initrd is not needed when you have a separate ext2 boot partition, and the only thing you should care about on that liveusb guide is the bit about the syslinux bootloader. In my case grub has worked just fine, but apparently some chipsets won't recognize a grub MBR on a usb drive, so to be on the safe side it's better to use syslinux. In a lot of cases the device that is booted is called sda, but that is also chipset dependent. Also with some kernel options (I'm not really sure which) the device can be called /dev/uba.

As for other things to care about, there is tons of optimization tweaks you could apply when using a usb drive. Most importantly the speed is not that great (20 MB/s on usb2), so it might be a good idea to mount a few things into ram after booting. Also if you have a flash memory usb drive, you should be worried about the fact that generally you only have ~ 100.000 writes per bit on the device. Say you run a lot of compiles on the drive or use scripts that use lots of hard disk I/O, your usb drive might wear out quicker than you might expect.

Hope this helps,
_________________
Gigabyte G33-DS3R, E6850, 4gb ddr2-800, 8800GT, Acer AL2623W - amd64
MacBookPro 2.4ghz, 2gb ddr2-667 - ~x86

Code:
ROOT="/mnt/coffeecup/" USE="sugar extra-sugar milk" emerge --update --deep --verbose --oneshot coffee
Back to top
View user's profile Send private message
Pearlseattle
Apprentice
Apprentice


Joined: 04 Oct 2007
Posts: 162
Location: Switzerland

PostPosted: Fri Oct 05, 2007 6:34 am    Post subject: Reply with quote

Guys, thanks a lot - I'll give it a try this weekend. Yes, I thought about the usb stick getting "old" quite quickly but I will initially compile everything on a normal hd and once it's done I will transfer everything to the usb stick. About log files, I thought I could mount the tmp directories into a small ramdisk. I'll think more in detail about this once I'm able to boot with the root filesystem... .
Thanks! :D
Back to top
View user's profile Send private message
merlijn
Apprentice
Apprentice


Joined: 10 Apr 2007
Posts: 161
Location: Den Haag, Holland

PostPosted: Fri Oct 05, 2007 7:14 am    Post subject: Reply with quote

Pearlseattle wrote:
Guys, thanks a lot - I'll give it a try this weekend. Yes, I thought about the usb stick getting "old" quite quickly but I will initially compile everything on a normal hd and once it's done I will transfer everything to the usb stick. About log files, I thought I could mount the tmp directories into a small ramdisk. I'll think more in detail about this once I'm able to boot with the root filesystem... .
Thanks! :D


If you have sufficient ram you could also just mount /var/tmp/portage/ in ram (read about tmpfs) and compile everything while running from the usb disk. And it is always important, but probably even a little more with flash usb disks, keep backups :D .
_________________
Gigabyte G33-DS3R, E6850, 4gb ddr2-800, 8800GT, Acer AL2623W - amd64
MacBookPro 2.4ghz, 2gb ddr2-667 - ~x86

Code:
ROOT="/mnt/coffeecup/" USE="sugar extra-sugar milk" emerge --update --deep --verbose --oneshot coffee
Back to top
View user's profile Send private message
whig
l33t
l33t


Joined: 27 Nov 2004
Posts: 973
Location: New Zealand

PostPosted: Fri Oct 05, 2007 7:42 am    Post subject: Reply with quote

On the kernel command line include "rootdelay=10" - it gives time for usb devices to appear.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum