WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Using mount in bootlocal.sh  (Read 10176 times)

Offline suxi

  • Newbie
  • *
  • Posts: 25
Using mount in bootlocal.sh
« on: September 19, 2012, 12:20:52 PM »
Hello Forum

I am sure this is a real noob question but I searched this forum and the net for quite a while and still haven't found a solution.

I would like to mount a raid drive at boot but adding mount /dev/sdb1 to my bootlocal.sh doesn't do anything.

This is my fstab file:

Quote
# /etc/fstab
proc            /proc        proc    defaults          0       0
sysfs           /sys         sysfs   defaults          0       0
devpts          /dev/pts     devpts  defaults          0       0
tmpfs           /dev/shm     tmpfs   defaults          0       0
/dev/zram0  swap         swap    defaults,noauto   0       0
/dev/sda1       /mnt/sda1       ext4     noauto,users,exec    0 0 # Added by TC
/dev/sda2       none            swap     defaults             0 0 # Added by TC
/dev/sda3       /mnt/sda3       ext4     noauto,users,exec    0 0 # Added by TC
/dev/sdb1       /mnt/sdb1       ntfs     noauto,users,exec,ro,umask=000 0 0 # Added by TC
/dev/sdb2       /mnt/sdb2       ntfs     noauto,users,exec,ro,umask=000 0 0 # Added by TC

Thanks a lot for any help

suxi




Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Using mount in bootlocal.sh
« Reply #1 on: September 19, 2012, 12:35:33 PM »
Did you install ntfs support?
I wouldn't know if RAID might require additional extensions as well.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Using mount in bootlocal.sh
« Reply #2 on: September 19, 2012, 12:38:34 PM »
Be careful with Windows BIOS fakeraid.  Mounting a fakeraid member under linux will likely break your RAID.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Using mount in bootlocal.sh
« Reply #3 on: September 19, 2012, 04:01:10 PM »
Hi suxi
If you have a hardware RAID controller card, see if this thread helps:
http://forum.tinycorelinux.net/index.php/topic,12624.msg68787.html#msg68787
« Last Edit: September 20, 2012, 09:42:06 AM by Rich »

Offline suxi

  • Newbie
  • *
  • Posts: 25
Re: Using mount in bootlocal.sh
« Reply #4 on: September 19, 2012, 05:14:25 PM »
Thanks a lot for the fast reply!

It's a 3ware controller and after I installed these extensions:

scsi-3.0.3-tinycore.tcz
raid-dm-3.0.3-tinycore.tcz
sg3-utils.tcz

the sdb1 and sdb2 partions of the raid  have been automatically added to my fstab. I can manually mount those after boot with mount /dev/sdb1 and /mount /dev/sdb2.

Actually, I don't think it's a raid issue because after boot only the TCE partition sda1 is mounted. I have to mount all other partitions manually in order to use them.

How do you guys autmatically mount partitions during boot?

Again, thanks for your support

suxi

EDIT:
Quote
Did you install ntfs support?
I think that came out of the box. I can access both partitions after mounting them manually.

Did I mention that I loooove the tiny core concept? I am setting up a simple samba file server for 10 windows users and the frugal concept is thrilling :)
« Last Edit: September 19, 2012, 05:18:33 PM by suxi »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Using mount in bootlocal.sh
« Reply #5 on: September 19, 2012, 05:28:43 PM »
Hi suxi
Are you running a 3.0.3 kernel? Open a terminal and enter:
Code: [Select]
uname -rIf it comes back as  3.0.21-tinycore  replace the scsi and raid-dm with the correct versions.

Tinycore only mounts partitions it needs to run automatically. You can add your mount command to bootlocal.sh.

Offline suxi

  • Newbie
  • *
  • Posts: 25
Re: Using mount in bootlocal.sh
« Reply #6 on: September 20, 2012, 03:23:20 AM »
Good morning!

It's the 3.0.21 kernel and (accidentally, thanks for pointing this out) I have the 3.0.21 scsi and raid extensions.

I tried adding  mount /dev/sdb1 as well as  mount /dev/sdb1 /mnt/sdb1 and mount -a to the bootlocal.sh but nothing gets mounted at boot. I can mount them using exact those commands manually, though.

I've just noticed that I am getting two errors during boot (please see attached jpeg):

1) mount: can't find /dev/sdb1 in etc/fstab could it be, that the fstab table has not been created at that point of boot?
2) Problems loading libtinfo.so I don't know what this is and how I can solöve it.

Thanks a lot and have a great day!

suxi


« Last Edit: September 20, 2012, 03:25:05 AM by suxi »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14788
Re: Using mount in bootlocal.sh
« Reply #7 on: September 20, 2012, 03:34:07 AM »
Problems loading libtinfo.so

If you use the "provides" function in the apps browser, it'll show you which extension you're missing.

In this case libtinfo.so is provided by the ncurses extension.

Note that if you use the apps browser to download/install extensions, it will automatically download/install all required dependency extensions.

Offline suxi

  • Newbie
  • *
  • Posts: 25
Re: Using mount in bootlocal.sh
« Reply #8 on: September 20, 2012, 03:48:33 AM »
Thank you for the tip on this "side issue". My apps browser hasn't got a provides function, but I could choose update and that found two ncurses extensions which I updated. That unfortunately didn't solve the mount problem, which really is a bummer ;)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Using mount in bootlocal.sh
« Reply #9 on: September 20, 2012, 09:32:07 AM »
Hi suxi
Maybe it's a timing problem. To verify, try this in your bootlocal.sh:
Code: [Select]
sleep 10
mount /dev/sdb1
If that works, we'll come up with a cleaner solution.

Offline suxi

  • Newbie
  • *
  • Posts: 25
Re: Using mount in bootlocal.sh
« Reply #10 on: September 20, 2012, 11:56:45 AM »
Hi Rich

Code: [Select]
sleep 10
This did the trick. Now I am really looking forward to the cleaner solution.

Thank you!

suxi

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Using mount in bootlocal.sh
« Reply #11 on: September 20, 2012, 12:17:40 PM »
Hi suxi
Create the following script in your /opt directory:
mountsdb1.sh
Code: [Select]
#!/bin/sh
until cat /etc/fstab | grep sdb1
do
  sleep 1
done
mount /dev/sdb1
Make it executable like this
Code: [Select]
chmod 775 mountsdb1.shAdd the following to your bootlocal.sh
Code: [Select]
/opt/mountsdb1.sh &If you also wish to mount sdb2, make a  mountsdb2.sh  script and add line in bootlocal.sh to call it too.
These scripts will run in the background until they find the device they are looking for and then mount the drive.

Offline ananix

  • Full Member
  • ***
  • Posts: 174
Re: Using mount in bootlocal.sh
« Reply #12 on: September 20, 2012, 12:26:00 PM »
Maybe im getting the issue wrong, but the clean solution here would be to make everything you need to boot your system persistent so its available doing kernel boot and use fstab the regular way.
Screams to me that you have to do a mount -a right after boot :( think all these issues should be taken care off doing boot not after.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11573
Re: Using mount in bootlocal.sh
« Reply #13 on: September 20, 2012, 12:42:30 PM »
Hi ananix
If you look at the screen shot fstab has been set up but sdb1 is not yet present. Tinycore boots very quickly
and what is probably happening is the RAID drivers have not yet completed configuring the drive. Once the
drivers have finished their task, the system is notified that another drive is present, and fstab is rebuilt to
include them. Having a script wait in the background for the drive to show up seems like the best solution.
Making fstab persistent would probably not solve anything since /dev/sdb1 is not present until the drivers
run. So the mount command would still fail.

Offline ananix

  • Full Member
  • ***
  • Posts: 174
Re: Using mount in bootlocal.sh
« Reply #14 on: September 20, 2012, 12:52:41 PM »
yeah i get you (i did not really think about the fstab more the extensions) thought the problem was pretty much like my broadcom Xtreme firmware problem if you remember, drivers and firmware not being pressent early enough, so i did misunderstand this subject :)
But it has just always seemed to me that disk mounting at boot was waiting if there where anything to wait for, but i have never been this far down in the boot process of a linux thinking of it other distroes also uses init scripts later in the process where they could add things like this hidden away as just the "system". But this is a core and i LOVE it :)
Also strikes me my first redhat 5.2 i had to do alot in the rc.local (bootlocal.sh equvilant) but i left linux (for true64 and Guardian) for a few years back then as it was to unstable and when i came back it was not only stable but also more "smooth" hiding away this stuff.
« Last Edit: September 20, 2012, 12:58:40 PM by ananix »