WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: boot from ntfs  (Read 15157 times)

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: boot from ntfs
« Reply #30 on: January 27, 2015, 02:39:12 PM »
Has anyone gotten this to work with a modern version of TC (5.x or 6.x)?  Please note, I *CAN* boot from an ntfs partition but I *CAN NOT* get the extensions located on the partition in the tce directory to automatically install during the boot process!!!  If so, what steps did you take to create the ramdisk image being used?  Also, note that this is a 64-bit version of the software, not 32-bit.

Worst case scenario can someone tell me what file I can call a script from that will duplicate the process of the onboot.lst.  This way I'll just loop through that file calling a 'tce-load -i ${EXT}'.  I can't believe it is this difficult to get something so trivial working...

Thanks,
Dave

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: boot from ntfs
« Reply #31 on: January 27, 2015, 03:53:00 PM »
Worst case scenario can someone tell me what file I can call a script from that will duplicate the process of the onboot.lst.  This way I'll just loop through that file calling a 'tce-load -i ${EXT}'.

Thanks,
Dave

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11618
Re: boot from ntfs
« Reply #32 on: January 27, 2015, 03:57:16 PM »
Hi wysiwyg
Sorry, I didn't realize this was 64 bit.

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: boot from ntfs
« Reply #33 on: January 27, 2015, 04:21:41 PM »
No problem, thanks for you help Rich.

Dave

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: boot from ntfs
« Reply #34 on: January 27, 2015, 07:02:31 PM »
Is the code to process the onboot.lst file in a script or a compiled program?  I think I should just be able to add that code verbatim or make a call to the binary as a temporarily solution to the problem.

Thanks,
Dave

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11618
Re: boot from ntfs
« Reply #35 on: January 27, 2015, 08:21:03 PM »
Hi wysiwyg
It's part of the  /etc/init.d/tc-config  script.

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: boot from ntfs
« Reply #36 on: January 28, 2015, 10:24:46 AM »
Good morning everyone!  To my surprise the problem encountered by TC not loading the onboot.lst file was that it was edited by a Windows editor at some point which caused the formatting to switch from Linux-based to Microsoft-based.  I re-created the onboot.lst on a Linux system and copied it over to the NTFS partition and everything worked like a charm!  I just wanted to point this out in case anyone comes across this post and are running into problems.  This will give them something else to check in an attempt to resolve the issue.

@Rich thanks for the info!  I actually figured out the above solution by placing some debug code in the /etc/skel/.ashrc file to show info during the final stage of the boot process.  Once I noticed some of the returned info was garbled, I figured out the solution.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: boot from ntfs
« Reply #37 on: January 28, 2015, 10:33:03 AM »
I re-created the onboot.lst on a Linux system and copied it over to the NTFS partition and everything worked like a charm! 

dos2unix command can change line ending.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11618
Re: boot from ntfs
« Reply #38 on: January 28, 2015, 10:36:37 AM »
Hi wysiwyg
Quote
... file was that it was edited by a Windows editor ...
This is a lesson that others have learned and has come up on this forum before. Running  dos2unix  on a text file will fix that assuming
the editor didn't add formatting (bold, underline, etc.). Run  unix2dos  on a text file if you want to open it with  notepad. Another one
that occasionally cause problems is forgetting to hit the carriage return on the last line of a file.

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: boot from ntfs
« Reply #39 on: January 28, 2015, 10:40:30 AM »
Just a follow-up so that if anyone stumbles across this post in an effort to enable NTFS booting by the most recent version of TC (6.x as of this posting), they will have a simple guide.  Here are the steps I took to reproduce this modification:

cd /tmp
wget http://tinycorelinux.net/6.x/x86_64/release/distribution_files/corepure64.gz
wget http://tinycorelinux.net/6.x/x86_64/release/distribution_files/vmlinuz64.gz
wget http://tinycorelinux.net/6.x/x86_64/tcz/fuse.tcz
wget http://tinycorelinux.net/6.x/x86_64/tcz/ntfs-3g.tcz

mkdir /tmp/remaster
mkdir /tmp/extension
cd /tmp/remaster
zcat /tmp/corepure64.gz | sudo cpio -i -H newc -d

sudo mount -t squashfs -o loop fuse.tcz /tmp/extension
cp -R /tmp/extension/* ./
sudo umount /tmp/extension

sudo mount -t squashfs -o loop ntfs-3g.tcz /tmp/extension
cp -R /tmp/extension/* ./
sudo umount /tmp/extension

sudo chroot /tmp/remaster depmod -a 3.16.6-tinycore64
sudo chroot /tmp/remaster ldconfig
sudo find | sudo cpio -o -H newc | gzip -2 > ../corepure64-ntfs.gz

That's all folks!  Be sure to note that the onboot.lst file (and any other tce directory files) need to be edited on a *LINUX* system, not a *MICROSOFT* system!  Also the above steps can be performed on any working Linux distro, not just a TC system.

Dave
« Last Edit: January 28, 2015, 11:04:53 AM by wysiwyg »

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: boot from ntfs
« Reply #40 on: January 28, 2015, 10:41:24 AM »
@Rich and @bmarkus thanks for the tips, good info for any user who stumbles across this post!

Dave

Offline SvOlli

  • Full Member
  • ***
  • Posts: 193
  • Linux Developer
Re: boot from ntfs
« Reply #41 on: January 28, 2015, 11:29:58 AM »
You can make you life a lot easier here.

Instead of merging several stuff into the original cpio, you can create a second one and load both from the bootloader. That way you don't need to rebuild the cpio, if the original initrd changes.

Been there, done that, ... a couple of times. ;-)
And yes, back then I didn't know that more than one initrd can be loaded at startup-time either...

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 713
Re: boot from ntfs
« Reply #42 on: January 28, 2015, 11:43:03 AM »
Great.

I am trying to make tcl for a pxe environment, and get this problems.

First I have some trouble with the rights on the files when i packed them into the tcz files.
my_root is a directory. User tc (1001) group staff (50).
I see when i run the tce-setdrive it sets the correct rights to the directory and the files.
And if I don't set the correct rights in the tcz file, it complains then i run the tce-load -wi "Access denied".
It's fixed then i run the tce-setdrive. I just wan't to run tce-setdrive.

So i changed the files with:
Code: (bash) [Select]
chown -R 1001:50 my_root
And a tip for the onboot.lst file, it is easy to create first with this command and then edit if needed.
Code: (bash) [Select]
(cd my_root/opt/tce/optional/ && ls -1 *.tcz) > my_root/opt/tce/onboot.lst

Offline wysiwyg

  • Sr. Member
  • ****
  • Posts: 266
Re: boot from ntfs
« Reply #43 on: January 28, 2015, 11:56:34 AM »
Just to clarify what SvOlli is saying in his post above... He is referring to modifying your bootloader config to use something like the following:

# an example of a traditional grub legacy line:
# initrd (hd0,1)/boot/ramdisk/tinycore.gz

# an updated version to load multiple 'ramdisks' (NOTE: some bootloaders may or may not need the comma):
# initrd (hd0,1)/boot/ramdisk/tinycore.gz, /boot/ramdisk/ntfs-3g.gz


@patrikg thanks for the additional tips for others visiting this thread!  Checking file permissions is something else to keep in mind while remastering things.  Of course if you use SvOlli's techniques, you can just use the official packages instead of creating your own!

Dave

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 713
Re: boot from ntfs
« Reply #44 on: January 28, 2015, 12:16:01 PM »
Yes, of course my previous  post was to make some additional tips.
My pxe boot config file is like this with two initrd:
My next project is figured out how to make my own mydata.tcz.

Code: (bash) [Select]
LABEL tcl
MENU LABEL Tiny Core Linux 6.0
KERNEL http://192.168.1.73/vmlinuz
INITRD http://192.168.1.73/core.gz,http://192.168.1.73/my_root.gz
APPEND quiet tce=/opt/tce norestore kmap=qwerty/sv-latin1 host=tcbox tz=CET-1CEST,M3.5.0,M10.5.0/3