Rodolfo Perez wrote:
> Hi
>
> I could install lfs-6.4 on my laptop and I'm really happy about my new
> lfs. 
> Now I would like to put it on my USB-Flash drive. I checked on lfs and
> was googeling.... but could not find a really satisfiying answer.
>
> I'd like to have a very small (max. 500Mb) lfs distro on my usb and it
> should be as lfs-live.
>
> Any help?
> Rodolfo
>
>   
I have just completed installing my LFS-6.5 (newly built) to a USB 
drive. What follows is how I was successful to make a bootable LFS USB 
drive..

I suggest you complete what Bruce suggests then:

Try this

1. prepare the USB drive by partitioning and formatting, I chose ext2 
file system.

2. mount the USB drive, example: /mnt/usb

3. copy LFS from the hard drive to the USB drive
    use a live CD or another install of linux, do not try to
    copy the LFS system if you are running it as /dev/ will
    give you trouble

rsync -var <source-LFS-location/*> <USB mount point>
or
cp  -var <source-LFS-location/*> <USB mount point>

example:
rsync -var /mnt/lfs/* /mnt/usb
    or
cp -var /mnt/lfs/* /mnt/usb

4. Install grub.

create menu.lst something like this and copy to /boot/grub/

# Config file for GRUB - The GNU GRand Unified Bootloader
# /boot/grub/menu.lst

timeout   5
default   0
color light-blue/black light-cyan/blue

title LFS 6.5 - USB
root (hd0,0)
kernel /boot/lfskernel-2.6.30.2 
root=/dev/disk/by-uuid/03e82132-a199-4601-a20e-106c444a2c5a ro quite
# EOF

The root (hd0,0) is correct, the USB drive will be hd0,0 at boot (you 
may have to change the last 0) if you copied LFS to a partition other 
than 1 (the first)

The kernel line should use the disk-by uuid...keeps one sane :)

to find the uuid
type at a CLI (terminal) blkid /dev/sdx - where sdx is the USB device
example from my "install":

blkid /dev/sdd1
/dev/sdd1: UUID="03e82132-a199-4601-a20e-106c444a2c5a" TYPE="ext2"

Now at a root CLI prompt         
grub
root (hdx,x)
setup (hdx)

The root line will vary according to the USB device is /dev/sdd1 is root 
(hd3,0), setup (hd3)
   
5.    Fixup /etc/fstab

example:

# Begin /etc/fstab
# file system  mount-point      type       options            dump  fsck
#                                                            
                                      order
/dev/disk/by-uuid/03e82132-a199-4601-a20e-106c444a2c5a / ext2 defaults 1 
    1
#/dev/xxx         swap             swap      pri=1                  0     0
proc               /proc            proc       defaults                
0     0
sysfs              /sys             sysfs      defaults                
0     0
devpts             /dev/pts         devpts     gid=4,mode=620     0     0
tmpfs              /dev/shm         tmpfs      defaults                
0     0
# End /etc/fstab

Again use disk/by-uuid with the uuid from the previous step
 

Reboot to the USB drive.


-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to