Jump to content
Science Forums

LFS on vfat usb


Recommended Posts

#mkdir /mnt/lfs/tools ...OK

#chown lfs /mnt/lfs/tools ...Operation not permitted

 

K what am I doing wrong? I thought that the LFS book said vfat was supported ...but I can't find that page right now. All I can find is this page saying only e2, e3, reiser, and xfs. But I don't think I can get grub to work on my stick so I want vfat so I can use syslinux.

 

mount -l says the usb is mounted rw, so wtf? I got as far as glibc 2nd pass on reiserfs usb.

 

P.S. I boot into an LFS livecd image located on my Arch partition, then mount both Arch and the usb then link to them from root.

Link to comment
Share on other sites

  • 1 month later...
  • Replies 37
  • Created
  • Last Reply

Top Posters In This Topic

Why are you putting all that straight down on the usb drive? wouldn't it make more sense to use squashfs or something and only manage the vfat boot partition with a boot loader, kernel and system config on there? Just curious, it just seems like you are doing this a bit backwards, to me...

Link to comment
Share on other sites

as far as syslinux goes, you only need two files on there ldlinux.sys and syslinux.cfg and your kernel for a successful boot. then run through the syslinux cfg

 

ex:

default Linux

label Linux

kernel bzImage

append root=/dev/hdc

 

and that should boot your kernel.

 

So then you just need a kernel with squashfs, and perhaps compression built in to pull up the rest of your data...? I dunno i haven't built a live distro in a while, but as far as i recall, that is basically how the boot process went?

Link to comment
Share on other sites

Why are you putting all that straight down on the usb drive? wouldn't it make more sense to use squashfs or something and only manage the vfat boot partition with a boot loader, kernel and system config on there? Just curious, it just seems like you are doing this a bit backwards, to me...

Well it was just a learning exercise. Are you saying I put linux on one partition and the /boot on vfat, or am I not understanding you?

 

as far as syslinux goes, you only need two files on there ldlinux.sys and syslinux.cfg and your kernel for a successful boot. then run through the syslinux cfg

 

ex:

default Linux

label Linux

kernel bzImage

append root=/dev/hdc

 

and that should boot your kernel.

 

So then you just need a kernel with squashfs, and perhaps compression built in to pull up the rest of your data...? I dunno i haven't built a live distro in a while, but as far as i recall, that is basically how the boot process went?

Thanks for the tips. I don't know anything about squashfs, is it just like a different partition type? I never got far enough to setup a bootloader, or kernel for that matter. After trying/retrying different versions of 64-bit LFS, I finally got x86 to build all the way through (on ext2,) but I had to use my USB for an Arch reinstall (after an update that weeded out a lot of us noobs.) I did save my 32-bit LFS tookit, tho. I think I'm gonna wait for 64-bit to mature a little, then retry.

Link to comment
Share on other sites

Squashfs is a compressed read-only file system in linux SquashFS - Wikipedia, the free encyclopedia

 

Its great for these distributions to put all your system stuff in there and whatnot

 

Let me see if i can dig up some docu for you for building live distributions, and creating bootable sectors and using squashfs and making ram disks and whatnot

Link to comment
Share on other sites

Ok, so here's what i have come up with for your delema :lol:

 

First of all, use grub, it wont have problems performing, on the USB drive, just make a small ext4 partition for grub and all your favorite magical boot files (like 35m would do, actually even less, that depends on your kernel), the rest you can mount as squash, and consider even making a small ram-disk partition for home directories and whatnot. You can probably make a swap-less boot, and try to maximize your kernel to be as lean as possible, but be able to support as much hardware (reasonably) as possible through the use of modules (remember anything that is not needed from the get-go, should be modularized)...

 

I think i would start with:

Partitioning the drive

setting up the ext4 partition for grub boot

creating a temporary working directory (ies) to be later converted to squashfs partition

creating your distro, installing kernel, drivers, what have you, making sure it all works (by booting using that kernel, and then chrooting into it) installing/testing software, etc.

Finally cleaning up all the logs, documentation (that takes up tons of space), finally squashing the system and dding it to a squash partition on your thumb drive. (remember you will need usb support built in, lzma, and squasfs as well as ext4 built inito the kenrel)

 

Finally, ofcourse testing all that :wave:

 

Hope some of this helps

here are some random references:

USB boot on Linux

Linux Convert ext3 to ext4 File system

How to make a live CD/DVD from your harddisk installation - Ubuntu Forums

SquashFS HOWTO

 

within those, you should get a really great idea on how you will go about building your lfs on usb system...

 

enjoy :)

Link to comment
Share on other sites

  • 2 weeks later...

Quick question. I backed up my first run toolkit on my ntfs and so now all the permissions are -r--------. I read about using find with chmod to sort through directories and files, but then it occurred to me that some of those files should be executable. Is there any way to find those also or should I just rebuild the first toolkit?

 

Edit: I could just make 'em all executable. Hell it's all temporary anyway. :sherlock:

Link to comment
Share on other sites

And again, that was fast. After

root [ /mnt/lfs/tools ]# find . -type f -exec chmod -v 755 '{}' ;

I get

chroot: cannot run command `/tools/bin/env': Input/output error

Sigh. Rebuild it is. *#$)%& microsoft

 

Let that be a lesson to all! Thou shalt not backup linux files on vfat or ntfs... o_O

Link to comment
Share on other sites

Well, I guess I could've backed it up in windows if I zipped it first.

 

Also, I think I got the error that I did after making everything executable because I forgot to do all the important stuff before trying to chroot into a blank partition.

mkdir -pv $LFS/{dev,proc,sys}
mknod -m 600 $LFS/dev/console c 5 1
mknod -m 666 $LFS/dev/null c 1 3
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts
mount -vt tmpfs shm $LFS/dev/shm
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...