LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 10-03-2005, 09:51 AM   #1
jimbo-62
Member
 
Registered: May 2005
Location: Utah
Posts: 102

Rep: Reputation: 15
How To Install LiveCD to Hard Drive


Here is a procedure that I used to install the LFS 6.1 Live CD to my hard drive. Use it at your own risk. The installed size is about 1.6 GB. You can delete the /sources directory and a file in / named .root.sqfs (or something similar) and reduce the size to about 1.3 GB.

1. Prepare a partition on your hard drive for LFS Live CD installation. Or maybe you want to use the whole hard drive. Format and install the file system of your choice. I used ext3.

2. Also prepare a swap partition. I used a swap equal in size to my RAM.

3. Boot the LFS Live CD. Configure your network so that you can connect to the Internet.

4. Mount the partition you want for your LFS Live CD hard drive installation
on /mnt. I used the following command.

# mount /dev/hda4 /mnt

5. Copy the system to your mounted partition. I used the following procedure.

# tar -C / -l -cpvf - . | tar -C /mnt -xpf -

6. Download a kernel source tar ball from kernel.org and put it in /mnt/usr/src. I used kernel 2.6.13.2. Make sure the kernel is in /usr/src of your new system, not in /usr/src of the Live CD.

7. chroot into your new system.

# chroot /mnt

8. Install the LFS bootscripts. I used the following procedure.

# cp /sources/lfs-bootscripts-3.2.1.tar.bz2 /usr/src/
# cd /usr/src
# tar -xvjf lfs-bootscripts-3.2.1.tar.bz2
# cd lfs-bootscripts-3.2.1
# make
# make install

9. Edit /etc/fstab. You need to delete references to union file system and add normal entries for a hard drive installation. The first two lines in my /etc/fstab are:

/dev/hda4 / ext3 defaults 1 1
/dev/hda5 swap swap defaults 0 0

10. Install the new kernel. I used the following procedure.

# cd /usr/src
# tar -xvjf linux-2.6.13.2.tar.bz2
# cd linux-2.6.13.2
# make mrproper
# make menuconfig (Set all configuration options that you need or want.)
# make
# make modules
# make modules_install
# cp arch/i386/boot/bzImage /boot/lfskernel-2.6.13.2
# cp System.map /boot/System.map-2.6.13.2
# cp .config /boot/config-2.6.13.2

11. Edit the bootloader of your choice for your new LFS Live CD system. I had another Linux system on my hard drive, so I added an entry to my existing /etc/lilo.conf as follows.

image=/mnt/hda4/boot/lfskernel-2.6.13.2
vga=791
label=LFS-LiveCD
root=/dev/hda4
read-only

12. Boot into your new hard drive installation of the LFS 6.1 Live CD and enjoy.

Good luck, jimbo
 
Old 10-03-2005, 04:35 PM   #2
CCMCornell
LQ Newbie
 
Registered: Sep 2005
Posts: 7

Rep: Reputation: 0
Neat tip. You should submit it as a hint to the LFS web site. I already finished my first LFS 6.1, but I'll definitely consider it the next time I do an LFS build. It was quite annoying having to find the CD every time I returned to the LFS build or listening to my loud CD drive spin up whenever I had to run something off the disk in another console while I was chroot'd in my LFS environment.

One question: why does the HD install require over 1 GB if the disk itself is only a couple hundred MB?
 
Old 10-03-2005, 06:30 PM   #3
jimbo-62
Member
 
Registered: May 2005
Location: Utah
Posts: 102

Original Poster
Rep: Reputation: 15
Thanks for the reply. I am not sure the LFS web site would appreciate a procedure that "short circuits" all of the painful compile steps.

The installed size does seem very large. I know that Live CDs use compressed file systems, but I didn't know they got that much compression.

jimbo
 
Old 10-04-2005, 02:30 PM   #4
jhuntwork
LQ Newbie
 
Registered: Mar 2005
Posts: 15

Rep: Reputation: 0
Why not? You should browse through the list of current hints to see how many there are that 'goes against the grain' of LFS, so to speak. I'm sure there are several people that would appreciate the hint. Though, as I'm sure you realize, that particular hint isn't likely to ever be officially supported by LFS or the LFS Livecd project.

Btw, the compression we get on the LiveCD is about 50%. Thanks to squashfs.

Also, your system ends up being more than double the size of the iso (approx 400Mb) because you are including the /proc and /sys filesystems in your dump. Those aren't necessary for the 'install' and take up a bunch of space when you dump them like that. You should find a way to skip those two directories in your dump.

--
JH
 
Old 10-05-2005, 02:41 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,599
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
I think that it would be a fine idea if the LFS (and BLFS) projects included that kind of information, if only as a last-resort step if you happen to really hose something up.

Also, the rsync command is very useful to look at. When used in strictly local mode (not involving the network... source and destination systems are the same) it is quite good at replicating things like symlinks and so-on which can confuse simpler commands. It's also clever at deciding what actually needs to be copied and what does not.

I agree that these instructions should be fleshed-out and published as an official document. It certainly has its place.
 
Old 10-06-2005, 02:09 PM   #6
shevegen
Member
 
Registered: May 2004
Distribution: Slackware / GoboLinux / LFS / VoidLinux
Posts: 145

Rep: Reputation: 26
Ok all worked except for the last one:


"11. Edit the bootloader of your choice for your new LFS Live CD system. I had another Linux system on my hard drive, so I added an entry to my existing /etc/lilo.conf as follows."

I dont have an existing bootloader (or working ones), should i just create the file /etc/lilo.conf and put up the settings for the kernel i compiled in there?
 
Old 10-06-2005, 06:34 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,599
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
lilo... ick! That's one place where I've always completely-ignored the LFS instructions. grub is a much better boot-loader, imho. Easy to set up, a great deal smarter overall, and if you encounter a glitch at boot-time you can quite easily fix it without grabbing for that rescue-CD. The configuration files are ordinary text-files and there's none of this balderdash of having to execute the 'lilo' command...
 
Old 10-06-2005, 07:54 PM   #8
jhuntwork
LQ Newbie
 
Registered: Mar 2005
Posts: 15

Rep: Reputation: 0
Quote:
Originally posted by sundialsvcs
lilo... ick! That's one place where I've always completely-ignored the LFS instructions.
When was the last time you actually looked at LFS then? Grub replaced Lilo in the LFS instructions a long time ago.

--
JH
 
Old 10-07-2005, 05:21 AM   #9
shevegen
Member
 
Registered: May 2004
Distribution: Slackware / GoboLinux / LFS / VoidLinux
Posts: 145

Rep: Reputation: 26
I personally dont really care if its Lilo, or Grub, i want an installed LFS system to HDD
with a working bootloader.

I think this last information lacks, for either lilo or Grub, so that you can boot into
your hdd installed LFS.

"I had another Linux system on my hard drive, so I added an entry to my existing /etc/lilo.conf as follows."

I try to google for the answer meanwhile
 
Old 10-07-2005, 09:03 AM   #10
jimbo-62
Member
 
Registered: May 2005
Location: Utah
Posts: 102

Original Poster
Rep: Reputation: 15
The entry I gave for my lilo.conf file is what you would use for any other lilo. But you would need normal lilo.conf entries preceeding the LFS section. Just look up an example lilo.conf file.

Good luck, jimbo
 
Old 11-12-2005, 02:58 PM   #11
Spoonman
LQ Newbie
 
Registered: Nov 2005
Posts: 4

Rep: Reputation: 0
Quote:
Originally posted by shevegen
I think this last information lacks, for either lilo or Grub, so that you can boot into
your hdd installed LFS.
The livecd has the sources for an LFS 6.1 build, you can just chroot into /mnt and build a copy of grub and install it.

This was a great hint, Jimbo, thanks. This is probably going to save my butt, as I've been trying to get an LFS 6.1 build to work for a little while now. I kept running into problem after problem, and it always came down to the fact that glibc does not compile properly if you compile it on a host that's running a 2.6.x kernel compiled with gcc 2.95 (which most distros still do). It took me forever to finally find a distro that worked, only to find it's glibc was too old and I had issues after a few of the temp tools were built. An LFS 6.1 makes a perfect host to build an LFS 6.1 on. It meets all the requirements AND for those few places where little things can creep into your build from the host...who cares? It's the same version!
 
Old 11-12-2005, 04:18 PM   #12
GoldCPUfish
LQ Newbie
 
Registered: Aug 2005
Distribution: PSkINk.
Posts: 1

Rep: Reputation: 0
The problem is that You need to be root in order to run X windows. Also You don't need to compile The kernel, There is a file called "linux" on the cd and thats the kernal.
 
Old 11-16-2005, 12:28 PM   #13
Spoonman
LQ Newbie
 
Registered: Nov 2005
Posts: 4

Rep: Reputation: 0
Quote:
Originally posted by jhuntwork
Also, your system ends up being more than double the size of the iso (approx 400Mb) because you are including the /proc and /sys filesystems in your dump. Those aren't necessary for the 'install' and take up a bunch of space when you dump them like that. You should find a way to skip those two directories in your dump.
Actually, it doesn't because he's using the "-l" (which is replaced in the next version with --one-file-system), this limits it to the root fs. Mounted filesystems, including /proc and /sys, aren't done. The only drawback is I've found different versions of tar implement this more or less right, depending on which one you get. The latest on the CD seems to handle it right, though.

-S
 
Old 11-20-2005, 10:34 PM   #14
jimbo-62
Member
 
Registered: May 2005
Location: Utah
Posts: 102

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by GoldCPUfish
The problem is that You need to be root in order to run X windows. Also You don't need to compile The kernel, There is a file called "linux" on the cd and thats the kernal.
The reason that I compiled a kernel was to eliminate any Live CD specific stuff that might be in there. Maybe not necessary, but I wanted to be sure I had a "clean" hard drive installation.

Good luck, jimbo
 
Old 12-02-2005, 05:18 PM   #15
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
Hi jimbo-62,

Tks for your work.

What about if I expect keeping /var and /home in separate partitions, say /dev/hda6 and /dev/hda7. How to make it after mounting them? Just moving them from /dev/hda4? TIA

BR
satimis
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I install lfs livecd on hard disk? bhxs1809 Linux From Scratch 3 02-25-2009 04:13 AM
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM
how to mount hard drive with a livecd? santaliqueur Linux - Software 8 10-07-2005 12:08 AM
install livecd to hard drive? jmille34 Linux From Scratch 7 07-21-2005 04:30 PM
Red Hat 7 install on hard drive using ULTRA100 drive fbwr75215 Linux - Software 4 04-15-2001 09:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 03:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration