How to automatically mount ext3 partition at boot-up?

Using applications, configuring, problems
Post Reply
Message
Author
M.O.
Posts: 2
Joined: Wed 26 Apr 2006, 10:59

How to automatically mount ext3 partition at boot-up?

#1 Post by M.O. »

Hello all, I am running Puppy Linux 1.08r1 on Toshiba Portege 3440 laptop. Puppy Linux is being started from MS-DOS 7.1 (~Win98) using grub4dos (with all apps & settings stored in C:\PUP001). I also have an ext3 partition containing my document files.

How can I make Puppy Linux automatically mount the ext3 partition during boot-up? I tried to add mount command into ~/.xinitrc, but it did not work. Thank you very much in advance for any help.

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#2 Post by rarsa »

First: You should add the mount command to the /etc/rc.d/rc.local file. The difference with the .xinitrc is that the rc.local executes when you bootup puppy while .xinitrc only executes when the X graphical environment starts.

Second: Where are you creating your mount point? When puppy runs in Ram, only /root is persistent. Any mount point that you create under /mnt will go away after you reboot.

If you still want to mount under /mnt, You will have to create the mountpoint at every boot before trying to mount the filesystem by adding the following to rc.local

Code: Select all

mkdir /mnt/<yourmountpoint>
mount /dev<yourdevice>  /mnt/<yourmountpoint>

for example

mkdir   /mnt/data
mount   /dev/hda3   /mnt/data
I would recommend to create a folder called "data" under /root and mount your other filesystem there, then you don't need to create the mountpoint every time.

The main advantage is that you will need less clicks to go to your data there as most applications 'file open' dialog opens in /root.
Last edited by rarsa on Wed 26 Apr 2006, 17:21, edited 1 time in total.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

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

#3 Post by MU »

The partitions also should be unmounted at shutdown.
Tool:
http://www.murga.org/~puppy/viewtopic.php?t=3140

Mark

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#4 Post by sunburnt »

This GUI app. mounts: FAT32, FAT16, EXT2, EXT3 & NTFS partitions at boot.
Attachments
xbootmount.gz
extract &amp; put it in /usr/sbin, &amp; drag to desktop to make link &amp; choose an icon.
(1.16 KiB) Downloaded 361 times

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#5 Post by Sit Heel Speak »

More precisely:

"...in puppy 1.x...anything written to /lib, /var, /dev, /bin, /sbin, in fact anything other than /etc, /usr and /root, isn't saved, unless you have a full hard drive install." --BarryK, March 15 2006, talking about Mark's new debian package installer.

pythoncoder
Posts: 59
Joined: Thu 09 Mar 2006, 17:53
Location: UK

#6 Post by pythoncoder »

This is one of the more puzzling features of Puppy for those of us who have used Linux before. Editing fstab is the method I've always used in the past, but Puppy seems to overwrite this file each time it boots despite its location in the /root tree.

I'd be intrigued to know why it does this.

Pete

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

#7 Post by MU »

Puppy initially just ran it RAM from CD, you just could save to /root.

Later, suppport for /usr was added using unionfs.
Normally, Puppy runs from CD, so all folders are write-protected!

Very simple explanation :)

Puppy2 uses a newer version of unionfs, that allows to make all writeprotected folders "writable".
Mark

pythoncoder
Posts: 59
Joined: Thu 09 Mar 2006, 17:53
Location: UK

#8 Post by pythoncoder »

Simple, for sure; except that it doesn't seem to fit the facts. I can edit /etc/profile and the changes survive a reboot, yet /etc/fstab gets overwritten.

/etc is of course a symlink to /root/.etc, so changed files are stored in the pupfile. Using explore2fs on a backup of my pupfile I can see both fstab and profile with the same owner and access rights. So the only explanation I can come up with is that Puppy overwites fstab each time it boots up.

Unless I'm missing something obvious, of course...

Pete

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#9 Post by sunburnt »

Simply put... Puppy doesn't use fstab at all.
Stop trying to do anything with it!
The app. xbootmount puts mount commands into a file which is run at boot by: /ect/rc.d/rc/local

User avatar
eMeRy
Posts: 86
Joined: Sun 22 Jan 2006, 20:22
Location: Hungary,Europe

#10 Post by eMeRy »

sunburnt wrote:... Puppy doesn't use fstab at all.
Let me modify this statement: Puppy ignores fstab at boot. But 'mount -a' and umount -a' work like in any other distro.
So I suppose if you complete fstab and place 'mount -a' to rc.local it will mount all drives from fstab.

Yes, it does. I checked it on my hd2 type installed system.

I recognized that my existing swap partition also remains 'off' after boot process even /etc/swappartition1 was correct.
So I put another line to rc.local file: 'swapon /dev/hda5' where hda5 is my swappartition. (maybe an expert could do better solution, e.g. editing rc.sysinit-hd file)

After reboot all wanted partition were mounted and swap was switched on.
Again: it is a full hd installed system! Live cd switches on swappartition if find one.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#11 Post by sunburnt »

eMeRy; Yes you can use fstab if you want, but Puppy doesn't use it.
Editing fstab is tricky for noobs, that's why I made the xbootmount GUI utility, to make it easy to do.
The only thing it won't do is mount the swap, I'd fix that but I'm writing a new utility that'll mount partitions, files, & Samba shares.
Swap partitions & files will also be listed for mounting with the GUI utility.
Unlike MUT which mounts immedately & xbootmount which mounts them at boot, the new one will do both.

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#12 Post by GuestToo »

if you set up fstab, Rox uses the information to allow you to mount/unmount partitions with one click

Rox 2.4.1 is even easier than Rox 1.2 ... if you click the mount point, it will automatically mount the drive, and automatically unmount it when you close the Rox window ... the cd drive should already be set up in fstab, just click /mnt/cdrom to automatically mount a cd (it will even automatically close the cd tray if it is open)

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#13 Post by sunburnt »

GuestToo; So I assume that it's a right click that does the mounting etc.?
Other wise where is the list of partitions to choose from?

For Rox 2.4.1 I assume that the mount points are made ahead of time (obviously).

GuestToo
Puppy Master
Posts: 4083
Joined: Wed 04 May 2005, 18:11

#14 Post by GuestToo »

where is the list of partitions to choose from?
if there is a device name and a mount point listed in fstab, Rox should be able to mount/unmount it

the appropiate mount points should have been created first, of course

the cd drive should already be setup in fstab ... for Rox 2.4.1, you just have to click the cdrom folder in a Rox window showing /mnt, to mount the cd and show you the files on the cd ... it will even close the tray automatically if the tray is open ... closing the Rox window will unmount the cd

for Rox 1.2, i think you have to hold the shift key or something when you click the folder, to mount it

i think there are mount/unmount options in the right click menus for both versions of Rox

i'm not sure about how hard drive partitions work, exactly ... i think it's pretty much the same way, it's been a while since i tried it

pythoncoder
Posts: 59
Joined: Thu 09 Mar 2006, 17:53
Location: UK

#15 Post by pythoncoder »

An interesting and erudite discussion! However nobody has commented on the point I attempted to make. With my hd1 type installation, changes I make to fstab don't survive a reboot (Puppy 1.0.8). This is despite the fact that I can successfully change other files in the same directory.

It seems as if Puppy treats fstab differently depending on whether you have a type 1 or type 2 installation, overwriting it each boot for a type 1 install.

Pete

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#16 Post by sunburnt »

pythoncoder; The modules.conf file's over written also, as I found, probably a few others as well.
I beleave Barry said in another post that Puppy 108 (& 109 I assume) doesn't wipe modules.conf, don't know about fstab.
Only solution I see is to somehow auto. make a backup at shutdown & restore it in rc.local at startup.

User avatar
eMeRy
Posts: 86
Joined: Sun 22 Jan 2006, 20:22
Location: Hungary,Europe

#17 Post by eMeRy »

Sorry pythoncoder, my situation is different from yours.
As I recognized case of 'common' puppy install, gurus use to save the base files to a safe directory (that surely saved before shutdown) than during reboot they copy back to its proper place.
So if I were you, I should modify the fstab than save it to for example to root directory than during boot copy it back to /root/.etc folder, to its original place and issue an 'mount -a'. Proper file for this the rc.local in /root/.etc/rc.d/ directory.
Its only hint, I haven'tried but hope it helps.
eMeRy

Post Reply