How to auto mount multiple hdd's on boot up?
- The Mighty Windle
- Posts: 6
- Joined: Sat 30 Jun 2007, 17:04
- Location: Scunthorpe, Britain's answer to water-torture
- Contact:
How to auto mount multiple hdd's on boot up?
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?
I have the following in /etc/fstab
and in /etc/rc.d/rc.local
Additional disks as needed...
Code: Select all
/dev/hdb1 /mnt/hdb1 ext3 defaults 0 0
Code: Select all
mount /dev/hdb1
- The Mighty Windle
- Posts: 6
- Joined: Sat 30 Jun 2007, 17:04
- Location: Scunthorpe, Britain's answer to water-torture
- Contact:
Cheers!
Thanking you muchly bugman, worked a treat!
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!
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!
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
or
you could use edit-initrd.pupand 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 both methods should work fine for a full hd install you only need edit the /ect/fstab once
you need to add it to fstab everytime like this from rc.local
Code: Select all
# 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
you could use edit-initrd.pupand 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 both methods should work fine for a full hd install you only need edit the /ect/fstab once
[url=http://hostfile.org/icepak.pet]176 Icewm Themes :!:[/url]
[url=http://tinyurl.com/39fl3x]vlc-0.8.6c-i586.pet[/url]
[url=http://tinyurl.com/2q7cbp]vlc-0.8.6c-i586.pet[/url]
[url=http://tinyurl.com/39fl3x]vlc-0.8.6c-i586.pet[/url]
[url=http://tinyurl.com/2q7cbp]vlc-0.8.6c-i586.pet[/url]
just a hack in progress
I hacked up the probepart3 script and got this hope it helps
someone try it and let me know
Code: Select all
#!/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###
Last edited by willhunt on Mon 09 Jul 2007, 06:18, edited 1 time in total.
[url=http://hostfile.org/icepak.pet]176 Icewm Themes :!:[/url]
[url=http://tinyurl.com/39fl3x]vlc-0.8.6c-i586.pet[/url]
[url=http://tinyurl.com/2q7cbp]vlc-0.8.6c-i586.pet[/url]
[url=http://tinyurl.com/39fl3x]vlc-0.8.6c-i586.pet[/url]
[url=http://tinyurl.com/2q7cbp]vlc-0.8.6c-i586.pet[/url]
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?
Will, am I to understand that this script would automount all disk drives and other devices plugged in when puppy boots?
Puppy Linux's [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!
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 [url=http://www.murga-linux.com/puppy/viewtopic.php?p=296352#296352]Mission[/url]
Sorry, my server is down atm!
Sorry, my server is down atm!
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
hard drive for a disscussion on usb look here
http://www.murga-linux.com/puppy/viewtopic.php?t=9581
[url=http://hostfile.org/icepak.pet]176 Icewm Themes :!:[/url]
[url=http://tinyurl.com/39fl3x]vlc-0.8.6c-i586.pet[/url]
[url=http://tinyurl.com/2q7cbp]vlc-0.8.6c-i586.pet[/url]
[url=http://tinyurl.com/39fl3x]vlc-0.8.6c-i586.pet[/url]
[url=http://tinyurl.com/2q7cbp]vlc-0.8.6c-i586.pet[/url]
- battleshooter
- Posts: 1378
- Joined: Wed 14 May 2008, 05:10
- Location: Australia
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:
Then try it out. If not successful, you can restore the .bak verion.
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: Select all
chmod +x /sbin/probepart
- battleshooter
- Posts: 1378
- Joined: Wed 14 May 2008, 05:10
- Location: Australia
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?
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?
- battleshooter
- Posts: 1378
- Joined: Wed 14 May 2008, 05:10
- Location: Australia
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.
It worked a treat, and automounted everything after editing /root/.xinitrc.
Re: Doesnt mount USB Drives
It's a Puppy quirk. I'll describe it in two phases: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?
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.
Re: How to auto mount multiple hdd's on boot up?
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:
Does it need to be any more complicated than this?
tgeer
Code: Select all
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1
tgeer
- battleshooter
- Posts: 1378
- Joined: Wed 14 May 2008, 05:10
- Location: Australia
Re: How to auto mount multiple hdd's on boot up?
The way you suggested works, but I've always done it like this:tgeer43 wrote: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:Does it need to be any more complicated than this?Code: Select all
mkdir /mnt/sda1 mount /dev/sda1 /mnt/sda1
tgeer
Code: Select all
mount -t ext2 /dev/sda1 /mnt/sda1
Battleshooter
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]
-
- Posts: 4
- Joined: Thu 10 Dec 2009, 04:57
Re: How to auto mount multiple hdd's on boot up?
thanks youbattleshooter wrote:The way you suggested works, but I've always done it like this:tgeer43 wrote: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:Does it need to be any more complicated than this?Code: Select all
mkdir /mnt/sda1 mount /dev/sda1 /mnt/sda1
tgeer
Not sure why we were to fiddle with fstab. It may have been something that has been changed since 2xx series. Maybe someone will enlighten us.Code: Select all
mount -t ext2 /dev/sda1 /mnt/sda1
Battleshooter
adding line
Code: Select all
mount -t ntfs /dev/sda6 /mnt/sda6
mmh its truepaulh177 wrote:I noticed that willhunt's scripts all make reference to /ect/ and not /etc/
"it'll never work" Smile
Hmmmmmmmmm... NTFS rw support?
Hello,
I'm still having problems with this. It mounts the device as ro, but I want it to be rw.
I've the following line on /etc/fstab:
/dev/sdb1 /mnt/iomega ntfs rw 0 0
But when I do a:
mount /dev/sdb1
It mounts it with the following options (according to mount command w/o parameters).
ro, relatime, uid=0, gid=0, fmask=0177, dmask=077,nls=iso8859-1,mft_zone_multiplier=1
I rather like to use utf-8 also, but first I need to mount it rw.
BTW, I use NTFS because I planned to use this hard disk also for sharing things with other windows hosts, and due to journaling not available on vfat.
Thanks again,
I'm still having problems with this. It mounts the device as ro, but I want it to be rw.
I've the following line on /etc/fstab:
/dev/sdb1 /mnt/iomega ntfs rw 0 0
But when I do a:
mount /dev/sdb1
It mounts it with the following options (according to mount command w/o parameters).
ro, relatime, uid=0, gid=0, fmask=0177, dmask=077,nls=iso8859-1,mft_zone_multiplier=1
I rather like to use utf-8 also, but first I need to mount it rw.
BTW, I use NTFS because I planned to use this hard disk also for sharing things with other windows hosts, and due to journaling not available on vfat.
Thanks again,
- RetroTechGuy
- Posts: 2947
- Joined: Tue 15 Dec 2009, 17:20
- Location: USA
Re: Hmmmmmmmmm... NTFS rw support?
It is possible that your NTFS volume was not cleanly unmounted, and so Puppy (and most other Linux systems) will not permit writing to the volume (as this might corrupt it).fmmarzoa wrote:Hello,
I'm still having problems with this. It mounts the device as ro, but I want it to be rw.
I've the following line on /etc/fstab:
/dev/sdb1 /mnt/iomega ntfs rw 0 0
But when I do a:
mount /dev/sdb1
It mounts it with the following options (according to mount command w/o parameters).
ro, relatime, uid=0, gid=0, fmask=0177, dmask=077,nls=iso8859-1,mft_zone_multiplier=1
I rather like to use utf-8 also, but first I need to mount it rw.
BTW, I use NTFS because I planned to use this hard disk also for sharing things with other windows hosts, and due to journaling not available on vfat.
Thanks again,
Try putting the drive back on your Windows machine and perform a scan to correct any errors, then try mounting under Puppy again.
You could also try "ntfsfix" (open rxvt, and type the command at the prompt)
Incidentally, I use this on my WinXp to access ext2 volumes:
http://www.fs-driver.org/
Though it tends to be unhappy if you have more than 1 ext2 partition.
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]