How to automatically mount partitions at boot? (Solved)

Booting, installing, newbie
Post Reply
Message
Author
rob.mac
Posts: 7
Joined: Thu 25 Jun 2009, 18:02

How to automatically mount partitions at boot? (Solved)

#1 Post by rob.mac »

Greetings fellow users,
I've been using puppy for about a month now, and I am starting to run out of room on my main partition due to music I've transferred from my other computer.

So I was wondering, is there a way for me to mount the other partition?

Any help would be greatly appreciated, especially with some step-by-step instructions :).

Thanks,
Rob.
Last edited by rob.mac on Mon 20 Jul 2009, 14:41, edited 1 time in total.

User avatar
davids45
Posts: 1326
Joined: Sun 26 Nov 2006, 23:33
Location: Chatswood, NSW

#2 Post by davids45 »

G'day,

There are a few ways to mount a partition/drive or two during booting Puppy.
One method is to create and put a short executable file into /root/Startup that reads something like:

#!/bin/sh
mount -t ext2 /dev/sda3 /mnt/sda3
mount -t ext3 /dev/sdb5 /mnt/sdb5

I called my file "mount-at-boot" as I want these two partitions (sda3 and sdb5) auto-mounted as they have my e-mail data, bookmarks and other stuff for Seamonkey, wine fonts, etc.

I also add lines to two files in other directories to be reasonably sure to get these partitions auto-mounted during boot.

To /etc/fstab, via ROX, I open this as text then I add a line (say, to mount sda3):
/dev/sda3 /mnt/sda3 auto defaults 0 0

To /etc/rc.d/rc.local, I open as text then add:
mount /dev/sda3

Save and close each file.

I sometimes need to re-boot a couple of times to get these partitions to display as mounted. I may have to actually access the partition manually for it then to be automatically mounted on re-boot.
But once it works, it has always been OK.

Search the forum for posts on auto-mounting or mounting during booting, for perhaps better or other information. This was how I found out how to do this.

David S.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#3 Post by disciple »

Weird. I just put this as a script in /root/Startup, and it works well for both my windows and linux partitions:

Code: Select all

#!/bin/sh
mount /dev/sda1 /mnt/sda1
mount /dev/sdb1 /mnt/sdb1
mount /dev/sdb3 /mnt/sdb3
mount /dev/sdb5 /mnt/sdb5
mount /dev/sdb6 /mnt/sdb6
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

rob.mac
Posts: 7
Joined: Thu 25 Jun 2009, 18:02

#4 Post by rob.mac »

Thanks!
It worked perfectly! :)

But shouldn't there also be a script that unmounts the partitions also? Or does it automatically do that?

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#5 Post by disciple »

Puppy automatically unmounts everything at shutdown/reboot.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

rob.mac
Posts: 7
Joined: Thu 25 Jun 2009, 18:02

#6 Post by rob.mac »

alright :)
Thanks a lot

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#7 Post by Sylvander »

Thanks to davids45, it worked 1st time. :D

Now I can move my Mozilla files onto the auto-mounted partition.

tmm2112
Posts: 12
Joined: Sat 25 Aug 2012, 04:54

#8 Post by tmm2112 »

Very much a noob, but I don't know how to make a script executable.

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#9 Post by Puppus Dogfellow »

tmm2112 wrote:Very much a noob, but I don't know how to make a script executable.
in rox, right click > (change) permissions.

someone will probably be along to tell you how to do it from the terminal as well.

tmm2112
Posts: 12
Joined: Sat 25 Aug 2012, 04:54

#10 Post by tmm2112 »

Puppus Dogfellow wrote: someone will probably be along to tell you how to do it from the terminal as well.
Sorry to sound so stupid, but what is "rox" and where do I find it?

tmm2112
Posts: 12
Joined: Sat 25 Aug 2012, 04:54

#11 Post by tmm2112 »

OK, so I found out that rox is just he file system. I clicked permissions, got a "+" and clicked the script. clicked the script and set permission. didn't work.

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#12 Post by Puppus Dogfellow »

tmm2112 wrote:
Puppus Dogfellow wrote: someone will probably be along to tell you how to do it from the terminal as well.
Sorry to sound so stupid, but what is "rox" and where do I find it?
tmm2112 wrote:OK, so I found out that rox is just he file system. I clicked permissions, got a "+" and clicked the script. clicked the script and set permission. didn't work.
rox is the default file manager in puppy. if you're looking at a file (and didn't install any additional file managers yourself), you're doing so through rox.

right clicking "permissions" on that script disciple wrote gives me a popup with four options--cancel, no, yes, quiet. either of the last two (the green buttons) will affirmatively answer the question the box is asking:

Change permissions of 'mnt/(whatever name and location)'?


...i don't get the screen you describe so that's all the advice i can give. if you've done it correctly (and haven't messed around with the default colors), the name of the script will now appear in green letters.


some of this is very unfamiliar at first. don't sweat it.

tmm2112
Posts: 12
Joined: Sat 25 Aug 2012, 04:54

#13 Post by tmm2112 »

disciple wrote:Weird. I just put this as a script in /root/Startup, and it works well for both my windows and linux partitions:

Code: Select all

#!/bin/sh
mount /dev/sda1 /mnt/sda1
mount /dev/sdb1 /mnt/sdb1
mount /dev/sdb3 /mnt/sdb3
mount /dev/sdb5 /mnt/sdb5
mount /dev/sdb6 /mnt/sdb6
I think I noticed something. My script is very similar to this, but with only one drive mounted. At bootup, the drive appears mounted for a second or two, then it goes away. At least that's what the GUI symbols suggest. A green circle appears then disappears. So I must be missing something that keeps the drive mounted.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#14 Post by bigpup »

tmm2112,
At bootup, the drive appears mounted for a second or two, then it goes away. At least that's what the GUI symbols suggest. A green circle appears then disappears. So I must be missing something that keeps the drive mounted.
What exactly is the drive partition you want to be mounted?
Partition on hard drive, USB drive, CD/DVD, what?
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

tmm2112
Posts: 12
Joined: Sat 25 Aug 2012, 04:54

#15 Post by tmm2112 »

bigpup wrote: What exactly is the drive partition you want to be mounted?
Partition on hard drive, USB drive, CD/DVD, what?
Sda2. It is a partition on the hard drive. Sorry, I thought I had stated that somewhere.

gcmartin

#16 Post by gcmartin »

Hi @Tmm2112. These instructions might help.

You indicate that you have already created a script of some name; say, you may have called it "your-mount-scriptname". Further you believe you have made that script "executable". The following instructions should help verify that you have done so properly.
  1. Open a terminal
  2. Position your terminal so you can see the drives icons on the bottom of your screen
  3. unmount the sda2 device

    Code: Select all

    # umount /dev/sda2
  4. Change to the directory where you added the script; should have done so here.

    Code: Select all

    # cd /root/Startup
  5. watching the icons below, Execute your script

    Code: Select all

    # ./your-mount-scriptname
  6. If it does execute, it will cause the sda2 icon to show it is now mounted. Otherwise, you may see some messages indicating why your script may not be working
Hope this helps
Attachments
sda2-Mounted.png
On my system, the mounted partition looks like this
(9.21 KiB) Downloaded 75 times

Post Reply