mount 2nd harddrive at boot up

Booting, installing, newbie
Post Reply
Message
Author
User avatar
paullecorde
Posts: 62
Joined: Fri 17 Jun 2005, 11:52
Location: Lexington, KY USA
Contact:

mount 2nd harddrive at boot up

#1 Post by paullecorde »

I have added a second hard drive to my Puppy PC. I want Puppy to mount this drive at boot up. I have added script /etc/rc.d/ to connect to broadband at boot up and to modprobe for sound. Is this the same place I would add script to mount drives at boot up and what script do I use?
From searching the internet I am thinking
mount /dev/hdb1 /mnt/data
(data is the name the mount wizard gives to this drive when I use it to mount the drive once Puppy is running).

Thank you for any suggestions!

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

Basically this looks ok, but Drives should be unmounted, when Puppy shuts down.

I had no look at how Puppy does it, maybe that drive will be ignored.
Simply try, and watch the messages you get at shutdown.

Mark

User avatar
puppian
Posts: 537
Joined: Tue 19 Jul 2005, 03:58
Location: PuppyLand
Contact:

#3 Post by puppian »

You can make a script file to mount your other partitions. This is what I'll show you how to do.

Taking the information I gathered from mount and probepart, I want to mount hda1 hda5 hda6, I'll call the script file /root/my-applications/bin/mhd
Code:
#!/bin/sh
# I can make my own mount points
mkdir /mnt/dos
mount -t vfat /dev/hda1 /mnt/dos
# I can also use the predefind ones as shown below
mount -t ext2 /dev/hda5 /mnt/linux2
mount -t ext2 /dev/hda6 /mnt/linux3

Before I reboot the computer, I need to unmount the devices, so I make another script to unmount the devices. I'll call it /root/my-applications/bin/uhd
Code:
#!/bin/sh
umount /mnt/dos
umount /mnt/linux2
umount /mnt/linux3

In order for the scripts to be executable, the file properties need to be set. I generally use 755 (owner=rwx, group=rx, other=rx).

# chmod 755 /root/my-applications/bin/mhd

I hope this helps. And as you know, there are many valid ways to mount devices. This is just one of many.

You can run these scripts on the command line, make shortcuts on the desktop with Rox, or make menu items for them.

==========

The above is copied from this page:
http://www.goosee.com/puppy/wikka/MounTing

If you have many partitions on your harddrive (e.g hdx10 or more), you'll need to add something like this too:
mknod /dev/hdb12 b 3 76

Code: Select all

# mknod
BusyBox v0.60.5 (2004.09.18-02:04+0000) multi-call binary

Usage: mknod [OPTIONS] NAME TYPE MAJOR MINOR

Create a special file (block, character, or pipe).

Options:
        -m      create the special file using the specified mode (default a=rw)

TYPEs include:
        b:      Make a block (buffered) device.
        c or u: Make a character (un-buffered) device.
        p:      Make a named pipe. MAJOR and MINOR are ignored for named pipes.
The value of major and minor can be found in the file /proc/partitions

==========

To auto-mount on start up, put

Code: Select all

mhd &
before the line

Code: Select all

CURRENTWM="`cat /etc/windowmanager`"
in the file /root/.xinitrc

You can write a script to auto-unmount too, e.g,

Code: Select all

#!/bin/sh
#  Command to shutdown the system
umount /mnt/dos
umount /mnt/linux2
umount /mnt/linux3
icewmpoweroff
save it as 'shutdownIce' and make it executable.

To set hotkey, put this line in /root/.icewm/keys

Code: Select all

key "Ctrl+Alt+F4"		shutdownIce
[url=http://puppylinux.org]Puppylinux.org - Community home page of Puppy Linux[/url] hosted by Barry (creator of Puppy), created and maintained by the [url=http://puppylinux.org/user/readarticle.php?article_id=8]Puppy Linux Foundation[/url] since 2005

User avatar
paullecorde
Posts: 62
Joined: Fri 17 Jun 2005, 11:52
Location: Lexington, KY USA
Contact:

#4 Post by paullecorde »

Thanks. The mhd and uhd scripts appear to be working.....

User avatar
puppian
Posts: 537
Joined: Tue 19 Jul 2005, 03:58
Location: PuppyLand
Contact:

#5 Post by puppian »

You're welcome :)
[url=http://puppylinux.org]Puppylinux.org - Community home page of Puppy Linux[/url] hosted by Barry (creator of Puppy), created and maintained by the [url=http://puppylinux.org/user/readarticle.php?article_id=8]Puppy Linux Foundation[/url] since 2005

User avatar
Dranoweb
Posts: 3
Joined: Sun 12 Apr 2009, 04:12
Location: Australia
Contact:

#6 Post by Dranoweb »

I found that adding these scripts into the /root/startup dir worked more reliably.

I also discovered that if you connected at boot, one can automount USB sticks too.

I had however set the "vfat" to "ntfs" for my fixed disk and "auto" for the usb.

adding the line to /root/.xinitrc did not appear to work for me.

Keep in mind I'm still new to puppy.

I'm using puppy 4.2 having migrated from 4.1.2

Installed on a 2gb usb stick in superfloppy mode.

Post Reply