WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Identifying which mount holds a frugal instal  (Read 2726 times)

Offline qopit

  • Jr. Member
  • **
  • Posts: 81
Identifying which mount holds a frugal instal
« on: May 22, 2012, 02:14:04 PM »
Is there a clean way to quickly/automatically determine which mount holds the frugal install?

To explain: I'm running Core within a VM, and the Core files normally exist under /mnt/sda1/tce.  However, when I add a few extra drives to the system, Core is now mounting the "main" drive as /mnt/sdc1 instead, which is breaking a few scripts that were hard linked to /mnt/sda1 paths.  I never did like my hard paths for exactly this reason, and now I'm bitten by it.  What I'm doing now is trying to set up bootlocal.sh to figure out which mount is the right one.  A crude script for prowling the mounts and looking for a certain signature (eg: existence of tce/boot off the root) works well enough, but is too klugey.

I figure there must be a quick way to identify the location of the kernel file (vmlinuz) in extlinux (or grub or whatever), or something along that lines, but can't find it.

Offline qopit

  • Jr. Member
  • **
  • Posts: 81
Re: Identifying which mount holds a frugal instal
« Reply #1 on: May 22, 2012, 02:22:54 PM »
Ok - using fdisk -l to get the boot device seems to work...

Code: [Select]
BOOT_MNT=`fdisk -l | grep /dev/.*[*] | cut -f 1 -d " " | sed "s|dev|mnt|"`
not sure how robust that is yet.  The grep is dicy with matching any asterisk after a /dev, not that I know of anything that would violate that.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Identifying which mount holds a frugal instal
« Reply #2 on: May 22, 2012, 03:00:35 PM »
readlink /etc/sysconfig/tcedir

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Identifying which mount holds a frugal instal
« Reply #3 on: May 22, 2012, 03:11:42 PM »
Quote
I figure there must be a quick way to identify the location of the kernel file (vmlinuz) in extlinux (or grub or whatever), or something along that lines, but can't find it.

Yep, no such thing. This is why it's recommended to use UUID or LABEL to detect drives.
The only barriers that can stop you are the ones you create yourself.

Offline qopit

  • Jr. Member
  • **
  • Posts: 81
Re: Identifying which mount holds a frugal instal
« Reply #4 on: May 22, 2012, 03:13:01 PM »
readlink /etc/sysconfig/tcedir

Ahh... much cleaner.  Thank you!  I should have thought of how the system identifies the extension dir.

Offline qopit

  • Jr. Member
  • **
  • Posts: 81
Re: Identifying which mount holds a frugal instal
« Reply #5 on: May 22, 2012, 03:31:16 PM »
Ouch.  I went on an expedition to figure out how Core figures out what to link /etc/sysconfig/tcedir to behind the scenes (it is done in /usr/bin/tce-setdrive)... but now I have a headache.  There is some serious shell scripting wizardry in these Core scripts.

In short: Core rocks.  I just wish I could follow it better!!

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Identifying which mount holds a frugal instal
« Reply #6 on: May 23, 2012, 07:30:15 AM »
Given a lack of tce= bootcode, it's a simple loop of all drives checking for /tce.
The only barriers that can stop you are the ones you create yourself.