Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 24 Apr 2014, 06:48
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to auto mount multiple hdd's on boot up?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [30 Posts]   Goto page: 1, 2 Next
Author Message
The Mighty Windle


Joined: 30 Jun 2007
Posts: 6
Location: Scunthorpe, Britain's answer to water-torture

PostPosted: Mon 02 Jul 2007, 14:30    Post subject:  How to auto mount multiple hdd's on boot up?
Subject description: Would like to know what script/s i need to alter please
 

Could someone please tell me what i need to insert and where (oo-er!) script-wise to get Puppy to auto mount all my hard disks? Shocked
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger 
bugman


Joined: 20 Dec 2005
Posts: 2131
Location: buffalo commons

PostPosted: Mon 02 Jul 2007, 14:35    Post subject:  

I have the following in /etc/fstab

Code:
/dev/hdb1     /mnt/hdb1    ext3     defaults               0 0


and in /etc/rc.d/rc.local

Code:
mount /dev/hdb1


Additional disks as needed...
Back to top
View user's profile Send private message Visit poster's website 
The Mighty Windle


Joined: 30 Jun 2007
Posts: 6
Location: Scunthorpe, Britain's answer to water-torture

PostPosted: Mon 02 Jul 2007, 14:53    Post subject: Cheers!  

Thanking you muchly bugman, worked a treat! Very Happy
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger 
PaulBx1

Joined: 16 Jun 2006
Posts: 2308
Location: Wyoming, USA

PostPosted: Mon 02 Jul 2007, 16:42    Post subject:  

Doesn't /etc/fstab (unlike rc.local) get replaced in an update? If so, wouldn't it make sense to put all the info in the mount command itself, in rc.local? (If that can be done; I'm not actually sure it can.)

I know in regular linux and unix systems fstab is part of the the administrator's data, but I think with Puppy it is more like something static that comes with the system. That's how I've been looking at it anyway, not sure it's correct. I haven't done a "mount -a" in Puppy yet!
Back to top
View user's profile Send private message 
willhunt


Joined: 05 Oct 2005
Posts: 495

PostPosted: Mon 02 Jul 2007, 17:08    Post subject:  How to mount all your Drives at bootup  

if you are using the live-cd option
you need to add it to fstab everytime like this from rc.local
Code:

# add new entry to the bottom of fstab you need one for each drive
# some vaild coloum 3 options ext2, ext3, reiserfs, swap, vfat, ntfs,
#auto means filesystem type is detected automatically.
echo /dev/hdb1     /mnt/hdb1    auto     defaults               0 0 >>/ect/fstab
# you must make the directory for each fstab entry before you try to mount or it will fail
mkdir /mnt/hdb1
#then the mount -a should work to mount all your partitions defined in fstab
mount -a

or

you could use edit-initrd.pup and edit /ect/fstab in the initrd.gz from your puppy iso to reflect the drives in your machine then ISOmaster to copy the new initrid.gz back to the iso be sure to rename the iso file Smile both methods should work fine for a full hd install you only need edit the /ect/fstab once Very Happy

_________________
176 Icewm Themes Exclamation
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
Back to top
View user's profile Send private message 
willhunt


Joined: 05 Oct 2005
Posts: 495

PostPosted: Tue 03 Jul 2007, 05:28    Post subject: just a hack in progress  

I hacked up the probepart3 script and got this hope it helps
Code:

#!/bin/sh
#LGPL 2007 Puppy Linux www.puppyos.com
#replacement for antonio gallo's probepart.
#written by plinej (Jason). Some mods by BK.
#April 25th 2007
# badly abused by Dougal, April 26th
# update: May 3rd

#[ -d $HOME/.config/tmp ] || mkdir -p $HOME/.config/tmp 2>/dev/null
#SUNITS="$1" #allowed params are '-k' or '-m'.
rm -f $HOME/.config/tmp/probepar*

OUTPUT=""
###get partitions
# scsi cds and devs without partitons
#SCSIPARTS="`grep -E 'scd[0-9]|sd[a-z] ' /proc/diskstats | tr -s ' ' | cut -d' ' -f4 | tr '\n' ' '`"
SCSIPARTS="`ls -1 /sys/block | grep -E 'sd[a-z]|sr[0-9]' | tr '\n' ' '`"
# normal partitions (sorting backwards cosmetic: we're adding new items at
# the beginning
PARTS="`grep '[hs]d[a-z][0-9]' /proc/partitions | tr -s ' ' | cut -d' ' -f5 | sort -r | tr '\n' ' '`"

## Dougal: originally had here  the last part (that does most of the work)
## Why did I move it? To get things in a nice order: hda1...hdb1...hdc...sda1..

###get ide drives (other than hard disks)
#SIZE=0
for DEV in `cd /proc/ide ; ls hd[a-z] | sort -r`
do
  # skip devices with partitions
  case "$PARTS" in *$DEV*) continue ;; esac
  if [ "`cat /proc/ide/$DEV/media`" = "cdrom" ]; then
   FSTYPE="iso9660"
  else
   FSTYPE=`/usr/lib/mut/bin/guess_fstype /dev/$DEV 2>/dev/null`
   [ "$FSTYPE" = "unknown" ] && FSTYPE="none" #for compatibility with old probepart.
  fi
#  SIZE=`grep "$DEV$" /proc/partitions | tr -s ' ' | cut -f 4 -d ' '`
#  [ ! "$SIZE" ] && SIZE=0
#  [ "$SUNITS" = "" ] && let SIZE=SIZE*2    #512 byte blocks
#  [ "$SUNITS" = "-m" ] && let SIZE=SIZE/1024 #MB units
#  seem to need this
  if [ $FSTYPE ! "none" ]; then
   OUTPUT="/dev/$DEV    /mnt/$DEV    $FSTYPE    defaults    00"
 mkdir /mnt/$DEV
echo $OUTPUT >>/ect/fstab
mount /dev/$DEV /mnt/$DEV
fi
done

###get scsi drives
for SCSI in $SCSIPARTS
do
  # skip devices with partitions
  case "$PARTS" in *$SCSI*) continue ;; esac
  case "$SCSI" in
   sr*) # cdrom
     MEDIA="cdrom"
     FSTYPE=iso9660
     SIZE=0
     ;;
   sd[a-z]) #other
     MEDIA="Direct-Access"
     FSTYPE=`/usr/lib/mut/bin/guess_fstype /dev/$SCSI 2>/dev/null`
     [ "$FSTYPE" = "unknown" ] && FSTYPE="none" #for compatibility with old probepart.
#     SIZE=`grep "$SCSI$" /proc/partitions | tr -s ' ' | cut -f 4 -d ' '`
#     [ ! "$SIZE" ] && SIZE=0
#     [ "$SUNITS" = "" ] && let SIZE=SIZE*2    #512 byte blocks
#     [ "$SUNITS" = "-m" ] && let SIZE=SIZE/1024 #MB units
     ;;
  esac
  #changed here to output fstab format
  if [ ! $FSTYPE == "none" ]; then
  OUTPUT="/dev/$SCSI    /mnt/$SCSI    $FSTYPE    defaults    00"
 mkdir /mnt/$DEV
echo $OUTPUT >>/ect/fstab
mount /dev/$DEV /mnt/$DEV
fi
done

# now the part that's actually useful...
for DEV in $PARTS
do
  FSTYPE="`/usr/lib/mut/bin/guess_fstype /dev/$DEV 2>/dev/null`"
  [ "$FSTYPE" = "unknown" ] && FSTYPE="none" #for compatibility with old probepart.
#  SIZE=`grep "$DEV$" /proc/partitions | tr -s ' ' | cut -f 4 -d ' '`
#  [ ! "$SIZE" ] && SIZE=0
#  [ "$SUNITS" = "" ] && let SIZE=SIZE*2    #512 byte blocks
#  [ "$SUNITS" = "-m" ] && let SIZE=SIZE/1024 #MB units
  #changed here to output fstab format
  if [ ! $FSTYPE == "none" ]; then
   OUTPUT="/dev/$DEV    /mnt/$DEV    $FSTYPE    defaults    00"
mkdir /mnt/$DEV
echo $OUTPUT >>/ect/fstab
mount /dev/$DEV /mnt/$DEV
fi
done

#changed here to echo output to /ect/fstab
#echo -e $OUTPUT>> /ect/fstab
#cat $HOME/.config/tmp/probepart #print results.
#rm -f $HOME/.config/tmp/probepar*

###END###


someone try it and let me know

_________________
176 Icewm Themes Exclamation
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet

Last edited by willhunt on Mon 09 Jul 2007, 02:18; edited 1 time in total
Back to top
View user's profile Send private message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Thu 05 Jul 2007, 15:19    Post subject: Thanks  

This tip got me a new car! (its complicated....but true!)

Will, am I to understand that this script would automount all disk drives and other devices plugged in when puppy boots?

_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Fri 06 Jul 2007, 06:24    Post subject: Doesnt mount USB Drives  

Hi, have tested this (doing a backup system for someone). It doesnt seem to mount usb drives at startup...is there a different way of doing this?
_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
willhunt


Joined: 05 Oct 2005
Posts: 495

PostPosted: Mon 09 Jul 2007, 02:21    Post subject:  

sorry bout the wait yes the above script should now mount all your
hard drive for a disscussion on usb look here
http://www.murga-linux.com/puppy/viewtopic.php?t=9581

_________________
176 Icewm Themes Exclamation
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
Back to top
View user's profile Send private message 
battleshooter


Joined: 14 May 2008
Posts: 1012
Location: Australia

PostPosted: Sun 06 Jul 2008, 02:45    Post subject:  

Hope this isn't a dumb question, but where exactly do I place this script Willhunt? I tried searching for "probepart3" but I can't seem to find it.
Back to top
View user's profile Send private message 
muggins

Joined: 20 Jan 2006
Posts: 6668
Location: lisbon

PostPosted: Sun 06 Jul 2008, 03:13    Post subject:  

battleshooter,

I haven't tried the script, but to test it out just copy your existing /sbin/probepart to /sbin/probepart.bak, then copy&paste willhunt's script in a text editor, & save as /sbin/probepart. Then enter:

Code:
chmod +x /sbin/probepart


Then try it out. If not successful, you can restore the .bak verion.
Back to top
View user's profile Send private message 
battleshooter


Joined: 14 May 2008
Posts: 1012
Location: Australia

PostPosted: Mon 07 Jul 2008, 00:33    Post subject:  

Thanks for the quick reply!

It's kinda strange what happened- I did everything like you said Muggins, but when I rebooted and clicked on a shortcut to a folder in a normally unmounted drive, it gave the usual :"File doesn't exist, or I can't access it: /mnt/hda5/My Documents" as if it wasn't mounted. (The shortcut is on the desktop)

But when I looked at it from /mnt/ it showed it was mounted-and it was mounted. I was able to access hda5. Any ideas?
Back to top
View user's profile Send private message 
battleshooter


Joined: 14 May 2008
Posts: 1012
Location: Australia

PostPosted: Sun 27 Jul 2008, 18:41    Post subject:  Solved!  

Just thought I'd mention my problem's been solved. First I used hotpup for automounting, but due to read only ntfs issues, I wrote my own script according to Puppian's post: http://www.murga-linux.com/puppy/viewtopic.php?t=2996

It worked a treat, and automounted everything after editing /root/.xinitrc.
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11052
Location: The Peoples Republic of California

PostPosted: Sun 27 Jul 2008, 19:08    Post subject: Re: Doesnt mount USB Drives  

ecomoney wrote:
Hi, have tested this (doing a backup system for someone). It doesnt seem to mount usb drives at startup...is there a different way of doing this?


It's a Puppy quirk. I'll describe it in two phases:

1) Linux boots to the prompt

At this point Puppy doesn't likely have all the USB modules loaded.

Boot to prompt and type lsmod. Note which USB modules are loaded.


2) Start X

Something in running xwin gets the missing module loaded. Not run lsmod and see what that module is.

Install that module in rc.local using the modprobe command and before the instructions to mount devices.

-------------------------

The problem is that rc.local runs before xwin.

See if this works.
Back to top
View user's profile Send private message 
tgeer43


Joined: 22 May 2009
Posts: 45

PostPosted: Sun 07 Jun 2009, 01:30    Post subject: Re: How to auto mount multiple hdd's on boot up?
Subject description: I did it with a little simpler method
 

I didn't mess with fstab and I didn't run any long script since I already know the drives that I want mounted. I just added the following two lines (per drive to be mounted) to my /etc/rc.d/rc.local:
Code:
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1

Does it need to be any more complicated than this?

tgeer
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [30 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0997s ][ Queries: 12 (0.0089s) ][ GZIP on ]