Re: [lfs-support] Another Question on Dual Boot

2016-09-18 Thread Paul Rogers
MIA
- Original message -
From: Paul Rogers 
To: lfs-support-requ...@lists.linuxfromscratch.org
Subject: Re: Another Question on Dual Boot
Date: Sat, 17 Sep 2016 21:54:33 -0700

> I have built an LFS system that I now wish to migrate to my main box.
> To do this, I plugged in a USB drive, mounted it to /root/tmp , and
> ran the command: dd if=/dev/sda1 bs=64K | gzip -c  > tmp/drive.gz

That step is problematic.  You're transplanting the whole partition.
That's not the thing to do.  Partitions have a first "track" disk
parameter block, i.e. MBR, just as drives do.  It's specific to the disk
geometry.  Yes, they can contain boot code--how does chain loading work,
eh?  ;-)  Secondly, the partiton table of the new drive won't have the
soon to be second partition defined--and even if you predefine it, the
transplanted partition won't "look right".

What you need to do is boot into single user mode, then tar it to the
USB using the -l parameter so it doesn't take other filesystems, e.g.
/proc /sys /run, et al.  Then restore them on a partition you defined
and formatted using your LiveCD in the main box.

> On my main box, I will fire up a live cd, plug in my USB drive and
> restore with this command gunzip -c tmp/drive.gz | dd of=/dev/sda2
> bs=64K The reason it won't be sda1 is because windows is on there.

No problem at all.

> After doing that, I will chroot into the newly restored system and run
> grub-install /dev/sda

In my experience, I never quite get the parameters right to make that
work properly, and it turns into a big time waster.  Since my systems
are old enough to still have floppy drives, I just type in a basic boot
command to a GRUB rescue floppy, single, then run grub-install.  Get
GRUB on your new box to make you a rescue USB thumbdrive.  (Something I
haven't had to explore yet.)

> And of course, I'll update /etc/fstab /etc/hosts /etc/hostname and so
> on to conform to the new system.

You still didn't touch the partition table.

> My question is on the grub.cfg syntax so that I can boot windows. I
> guessed it will probably look something like this: menuentry "Windows
> 7" { insmod chain insmod ntfs set root=(hd0,msdos1) chainloader +1 }
> Will that work, or will I need something more complex?

Simpler.  Use grub-mkconfig, and then edit it HEAVILY into some kind
of sanity.

-- 
http://www.fastmail.com - Same, same, but different...

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

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] Another Question on Dual Boot

2016-09-17 Thread Rob
Bruce Dubbs  wrote: 

That's too hard. Just mount the formatted /dev/sda2 as e.g.
/media.
cp -a /root/tmp/* /media


I gave that a try just to see what would happen. It led to some
unpredictable results. I got a bunch of messages about how preserving
permissions of various files in /var/log was
unsupported. In addition, some of the binaries were whining about
not being owned by root and wouldn't execute. for example
/usr/bin/sudo
Another example was /run. Screen wouldn't execute, giving me
a message like
/run/screen: permission denied.
So I'll just stick with my method since I know it works.
Anyway, I did get the system migrated successfully in the end.

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

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] Another Question on Dual Boot

2016-09-16 Thread Ken Moffat
On Fri, Sep 16, 2016 at 05:48:45PM -0500, Rob wrote:
> My question is on the grub.cfg syntax so that I can boot windows.
> I guessed it will probably look something like this:
> menuentry "Windows 7" {
> insmod chain
> insmod ntfs
> set root=(hd0,msdos1)
> chainloader +1
> }
> Will that work, or will I need something more complex?

Looking at my backups from the box which ran win7 (the mobo died,
but the config seemed to work until that time), I had

# revised invocation based on gentoo
menuentry 'Windows 7 (loader) (on /dev/sda1)' {
insmod part_msdos
insmod ntfs
insmod chain
chainloader (hd0,1)+1
}

Mine used DOS partitions, hence the use of part_msdos : I guess that
part could have been in the general parms.  I suspect that what you
have suggested will do the same thing as what I cribbed from gentoo.

ĸen
-- 
`I shall take my mountains', said Lu-Tze. `The climate will be good
for them.' -- Small Gods
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style


Re: [lfs-support] Another Question on Dual Boot

2016-09-16 Thread Bruce Dubbs

Rob wrote:

I have built an LFS system that I now wish to migrate to my main box.
To do this, I plugged in a USB drive, mounted it to
/root/tmp
, and ran the command:
dd if=/dev/sda1 bs=64K | gzip -c  > tmp/drive.gz
On my main box, I will fire up a live cd, plug in my USB drive and
restore with this command
gunzip -c tmp/drive.gz | dd of=/dev/sda2 bs=64K


That's too hard.  Just mount the formatted /dev/sda2 as e.g. /media.

cp -a /root/tmp/* /media


The reason it won't be sda1 is because windows is on there.
After doing that, I will chroot into the newly restored system and run
grub-install /dev/sda
And of course, I'll update
/etc/fstab
/etc/hosts
/etc/hostname
and so on to conform to the new system.


Depending on your build, you may need to rebuild the kernel with the 
appropriate drivers.



My question is on the grub.cfg syntax so that I can boot windows.
I guessed it will probably look something like this:



menuentry "Windows 7" {
insmod chain
insmod ntfs
set root=(hd0,msdos1)
chainloader +1
}


I don't do Windows, so I can't help there.  What you have seems reasonable.

  -- bruce

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

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style