WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Howto dual boot tinycore and windows on a laptop using grub2  (Read 10750 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14790
I'm not saying this is the best or optimum way to do this, but it is a way to do it.

Use the laptop to boot tinycore from a usb stick.

Not essential, but to ensure the existing single partition on the laptop hard drive does not contain retrievable data:
Code: [Select]
$ tce-load -i coreutils
$ sudo shred --verbose -n1 /dev/sda1

Then use fdisk to create four primary partitions:
Code: [Select]
$ sudo fdisk /dev/sda
d [delete partition]
n [add partition]
t [set filesystem]
a [set bootable]
w [write filesystem]

sda1: ntfs code 7 [set bootable]
sda2: linux filesystem code 83 [set bootable]
sda3: linux swap code 82
sda4: linux filesystem code 83

Next make the file systems:
Code: [Select]
$ tce-load -i ntfsprogs
$ sudo mkntfs /dev/sda1
$ sudo mkfs.ext4 /dev/sda2
$ sudo mkswap /dev/sda3
$ sudo mkfs.ext4 /dev/sda4

Now reboot the laptop from a windows-7 dvd - when it asks, install it to the first partition, which will require several re-boots.

Once windows-7 has finally installed, reboot the laptop from the tinycore usb stick and copy the tinycore boot files from the usb stick to the second partition:
Code: [Select]
$ sudo mount /dev/sda2
$ sudo mkdir /mnt/sda2/boot
$ sudo cp /mnt/sdb1/boot/rootfs.gz /mnt/sda2/boot
[repeat for modules.gz, vmlinuz, rootfs64.gz, modules64.gz, vmlinuz64]

Install grub2 to the second partition:
Code: [Select]
$ tce-load -i grub2
$ sudo grub-install --boot-directory=/mnt/sda2/boot /dev/sda
Note when using a (u)efi boot machine to make a bios boot add "--target=i386-pc"

Use vi or other text editor to creat a grub2 configuration file such that:
Code: [Select]
$ cat /mnt/sda2/boot/grub/grub.cfg
insmod ext2

menuentry "rootfs" {
set root=(hd0,2)
linux /boot/vmlinuz quiet text
initrd /boot/rootfs.gz /boot/modules.gz
}

menuentry "rootfs64" {
set root=(hd0,2)
linux /boot/vmlinuz64 quiet tce=sda2/tce64 text
initrd /boot/rootfs64.gz /boot/modules64.gz
}

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

You can now reboot and use the grub2 menu to choose between tinycore, corepure64 and windows.
« Last Edit: September 23, 2014, 01:50:24 AM by Juanito »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Howto dual boot tinycore and windows on a laptop using grub2
« Reply #1 on: July 19, 2014, 09:05:18 AM »
Does deleting the current partition (f.e. Windows) in order to be able to create new partitions have any benefit compared to shrinking the current partition (apart from the potential risk of non successful shrinking)?

What is the questionmark symbol doing there?
Code: [Select]
...
}
?
menuentry "windows" {
...
« Last Edit: July 19, 2014, 09:18:56 AM by Misalf »
Download a copy and keep it handy: Core book ;)

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Howto dual boot tinycore and windows on a laptop using grub2
« Reply #2 on: July 19, 2014, 09:16:04 AM »
Phew... I nearly fired up  shred  in the terminal just to see what it does but figured I should ask the web first. Turned out it's kind of an equivalent to  format c: .

Might to warn us with poor man's terminology. :p
Download a copy and keep it handy: Core book ;)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14790
Re: Howto dual boot tinycore and windows on a laptop using grub2
« Reply #3 on: July 19, 2014, 09:35:18 AM »
If you had an existing windows laptop you could use ntfsprogs or gparted to shrink the windows partion (I've done this a couple of times), but this introduces more scope for problems. I was making the assumption of starting with a hard disk with nothing useful on it.

Errant "?" removed - thanks

Ref shred - I did make a comment about ensuring that the "hard drive does not contain retrievable data"

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Howto dual boot tinycore and windows on a laptop using grub2
« Reply #4 on: July 19, 2014, 10:11:19 AM »
So this seems to be the way to install TinyCore (+ dual boot) while following its philosophy - Using only what you really need. Which actually makes it quite simple. Thanks.

Quote
Ref shred - I did make a comment about ensuring that the "hard drive does not contain retrievable data"
Yes, you did. I see you don't say 'erasing' or 'deleting' as that's not what  shred  does.
Also for someone with good knowledge in the english language, "shred" doesn't need any further explaination.
I guess I'm more used to read tutorials for the masses.
Download a copy and keep it handy: Core book ;)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Howto dual boot tinycore and windows on a laptop using grub2
« Reply #5 on: July 19, 2014, 10:45:41 AM »
Thanks Juanito for the awesome grub2 extension

I would use secure erase which is built-in to every modern HDD,  secure erase is also the only method recommended for SSD's, am submitting updated secure erase extension from tc-4x this weekend for x86 & x86_64 repo's.

All my PC's multi-boot windows7 and various tinycore architectures, here is the grub.conf file from my main desktop

Code: [Select]

insmod part_msdos
insmod fat
insmod ext2
loadfont unicode
set gfxterm=auto
terminal_output gfxterm


#Timeout for menu
set default=1
set timeout=60



menuentry "TC-5-x86 (on SSD)" {
search --no-floppy --fs-uuid --set=root 5AE6-1546
linux /boot/vmlinuz-3813 noswap tz=GMT loglevel=3 waitusb=5:UUID="5d14ddd5-7fa7-40c5-a247-07ac5e9c6a8c" tce=UUID="5d14ddd5-7fa7-40c5-a247-07ac5e9c6a8c"/x86 opt=UUID="5d14ddd5-7fa7-40c5-a247-07ac5e9c6a8c" home=UUID="5d14ddd5-7fa7-40c5-a247-07ac5e9c6a8c" lst=onboot32nvidia.lst mydata=mydata32xorg
initrd /boot/rootfs-530.gz /boot/modules-3813.gz
}

menuentry "TC-5-x86_64 (on SSD)" {
search --no-floppy --fs-uuid --set=root 5AE6-1546
linux /boot/vmlinuz64-3813 noswap tz=GMT loglevel=3 waitusb=5:UUID="5d14ddd5-7fa7-40c5-a247-07ac5e9c6a8c" tce=UUID="5d14ddd5-7fa7-40c5-a247-07ac5e9c6a8c"/x86_64 opt=UUID="5d14ddd5-7fa7-40c5-a247-07ac5e9c6a8c" home=UUID="5d14ddd5-7fa7-40c5-a247-07ac5e9c6a8c" lst=onbootpure64.lst mydata=mydata64pure
initrd /boot/rootfs64-530.gz /boot/modules64-3813.gz
}

menuentry "Windows (on SSD)" --class windows --class os {
insmod part_msdos
insmod ntfs
insmod ntldr
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 20F27562F2753CDA
ntldr ($root)/bootmgr
}


menuentry "Windows (on HDD)" --class windows --class os {
insmod part_msdos
insmod ntfs
insmod ntldr
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root EE26108A261055C5
ntldr ($root)/bootmgr
}
« Last Edit: July 19, 2014, 11:11:42 AM by coreplayer2 »