LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 01-22-2010, 03:01 AM   #1
Sorrel
LQ Newbie
 
Registered: Jan 2010
Location: Central England
Posts: 3

Rep: Reputation: 0
Naming of partitions in Grub, and /dev, when building on separate (virtual) disk


I've been building LFS 6.5 on and off over the last week, and I've nearly got to the end.

I'm building inside VM-fusion with two virtual disks. One has my ubuntu host system, and the other is where I've been putting the lfs.

When chroot-ing to the system, the disks are sda for the ubuntu, and sdb for the lfs, and everything seems fine. But when I try and boot to the lfs disk, it can't find the partition to load. As it is sdb2, I had set the Grub script to root at (hd1,1), but this clearly doesn't work.

If I load from the second disk in VM fusion (setting the option in VM fusion to boot from the second virtual disk), does that make it now the primary disk as far as grub is concerned?If that is the case, I would guess I would need to change my system to root at (hd0,1) instead.

But what should I do with my /dev directory? I set it with "mount -v --bind /dev $LFS/dev" a while back, but is that now valid?

And are there any files I need to change, assuming the sdb disk will be considered sda by the system now?

Am I on the right track here?
 
Old 01-22-2010, 03:28 PM   #2
Sorrel
LQ Newbie
 
Registered: Jan 2010
Location: Central England
Posts: 3

Original Poster
Rep: Reputation: 0
Now I think I have a /dev problem

I think my guesses above were correct, and using root (hd0,1) seemed to get a bit further.

However, I am now getting the dreaded cannot mount partition error that seems to be quite popular around here.

When I look at my /dev folder, it only has null and console in it, which I think is the problem. I mounted the /dev directory from the host, as suggested in section 6.2.2 of the 6.5 LFS book, but when I start up in the new disk everything apart from null and console vanishes. I would guess that the link between the two disks is broken at this point, as the main disk isn't running, and therefore there is no content to go there.

So, how do I populate /dev in my target disk so that there is something there when I try and boot it for the first time? I can't find an easy answer anywhere, but there must be a way.
 
Old 02-17-2010, 01:26 PM   #3
fdt93
LQ Newbie
 
Registered: Apr 2005
Distribution: CLFS 6 / CBLFS 6
Posts: 14

Rep: Reputation: 1
From your original post, I'm drawing the following conclusions:

1. You have created 1 virtual machine in Fusion.
2. That vm has 2 virtual hard drives assigned to it.
3. You installed Ubuntu on 1 of the vhd's to use as the host system for LFS to be installed on the 2nd VHD.

Just following the instructions in the book should net you with a single virtual machine in Fusion that dual boots between Ubuntu and LFS. (There's one wrinkle to this which I will get into later)

If you wanted LFS to be it's own virtual machine in Fusion, then you've got a few extra steps to take. Here's what I would do:
1. create a new virtual machine in Fusion for LFS. Assign as much RAM as you want and point it's virtual hard drive to the vhd you built lfs on. (You may have to unassign it from the Ubuntu vm first. My experience is with Sun's Virtual Box, not with Vmware's Fusion product)
2.Boot to a live CD (or ISO image). you can use the Ubuntu install CD (choose the option to "try Ubuntu without changing system")
3.Once booted into the live CD, mount the vhd that has LFS built on it.
4.Follow the LFS instructions for entering the chroot environment. The "mount -v --bind /dev $LFS/dev" is just to expose existing devices to the temporary chroot environment. Otherwise grub won't see your proper hard drive(s). You have to redo this because it is undone whenever you reboot the virtual machine.
4.Follow the Grub configuration instructions in the LFS book again. This time LFS will only be on the only vhd so root(hd0,1) would be correct assuming LFS is built on the 2nd partition. If Lfs is on the 1st partition, then it needs to be root(hd0,0).
5.Unmount the CD/ISO from the virtual machine and boot from the vhd.

The dual boot config in 1 vm should work, but... if you used Ubuntu 9.10 as the host system... 9.10 uses Grub2 as it's boot loader. I used 9.10 as my host distro on my PC, and had issues getting the dual boot between LFS and U9.10 to work. I ended up not installing the LFS grub, and I let Ubuntu control the boot, and just added an entry for LFS into Ubuntu's grub config. There was a learning curve there because GRUB2's config is quite a bit different.

Hope this helps,
JasonL
 
Old 02-18-2010, 02:57 AM   #4
Sorrel
LQ Newbie
 
Registered: Jan 2010
Location: Central England
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the extra info fdt93.

I did eventually get the LFS to boot in the virtual machine, but I couldn't get the disks out of the read-only part of the boot, and so the whole filesystem was locked down.

It made me realise that I probably didn't know enough about booting linux, and its start-up sequence, so I've spent some time since then getting the hang of GRUB (both the 0.97 and the 1.97 versions) on a netbook, where I've created a Mint-Linux, Ubuntu and Slackware system that shares the /boot and /home directories across the three distributions. I think this has given me enough knowledge to feel more comfortable about getting the LFS to boot properly under VM Fusion.

I will probably start again with LFS in the future, but at the moment I'm busy with other things, and don't really have the time.
 
  


Reply

Tags
dev, fusion, grub, partition


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
grub-install /dev/fd0 on unmounted floppy disk vinaytp Linux - Newbie 6 11-18-2009 12:15 PM
Motherboard change impacts disk naming, requires grub reconfiguration? donv2 Linux - General 5 09-06-2006 12:45 PM
Is there a way to have grub translate its own naming to naming scheme under Linux zhjim Linux - Software 6 05-28-2006 08:09 AM
Separate Partitions for Separate User groups volvic Slackware - Installation 2 09-16-2004 02:42 AM
XP on a separate disk and GRUB config greg108 Linux - Newbie 3 08-10-2004 11:48 PM


All times are GMT -5. The time now is 11:35 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration