Run unmount automatically at startup

Booting, installing, newbie
Post Reply
Message
Author
dbmix
Posts: 16
Joined: Sat 03 May 2008, 12:20

Run unmount automatically at startup

#1 Post by dbmix »

I need to unmount a device and a file after puppy boots. There must be a file that will run commands after puppy boots, but I can't find it.

Background info if you are interested.

I have two SATA drives in my PC, made room at the end of the second drive using GPart and formatted them to ext2 and linux-swap ( made the swap 2 gigs even though I have 2 gigs of memory cause 4 gigs wouldn't work). Made the ext2 format bootable

I did a full install of Puppy to that ext2 partition and ran GRUB. to the partition and to a floppy - not to the MBR.

I booted windows and ran a program called bootpart. This created a file of the boot sector for linux and placed a call to it in the boot-ini file that windows uses to dual boot.

This works great. I get to choose at boot time which OS I want to run. If I choose Linux, it passes control to GRUB which then asks me again...will have to look more at that for workarounds... and then Puppy runs.

the problem is that after booting, I cannot mount the windows drive becuase the drive device and the boot sector file are already mounted.

So I would like to unmount them as soon as puppy boots.

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#2 Post by trapster »

automounting can be put into /etc/rc.d/rc.local maybe unmounting can too??

in /etc/rc.d/rc.local try:

umount /device/to/unmount

note: to unmount, use umount (no "n")
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#3 Post by rcrsn51 »

This sounds odd. First of all, in Linux-speak, you don't mount a drive. You mount a partition. Where exactly is Windows located? And what version of Puppy are you using?

Once Windows has passed control to GRUB, there would be no reason for Puppy to be mounting the Windows partition.

What happens when you try to mount the Windows partition? How do you know that it is already mounted?

dbmix
Posts: 16
Joined: Sat 03 May 2008, 12:20

#4 Post by dbmix »

rcrsn51 wrote:This sounds odd. First of all, in Linux-speak, you don't mount a drive. You mount a partition. Where exactly is Windows located? And what version of Puppy are you using?


Windows is on the first hard drive on the first primary partition - "C:"

Pppy version is 3.01
Once Windows has passed control to GRUB, there would be no reason for Puppy to be mounting the Windows partition.
I checked the mounted folder and the partition that is windows is mounted and the only file that shows is the boot sector file that is called by NTLDR. So maybe GRUB keeps that boot sector file mounted and because that file is on the windows partition, the partition cannot then be "remounted"

What happens when you try to mount the Windows partition? How do you know that it is already mounted?
Using Pmount, I get an error message - I don't have it to paste right now - that says the fusemount reports that mountpoint is already occupied and that the native ntfs driver is opening the device in read only mode. - the message is in red.

After playing with that scenario a few times, I umounted the device that is the windows partition and unmount the boot sector file within it. After that, Pmount works fine and all is well.

So I thought I would try to autounmount the device during the linux boot process

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#5 Post by rcrsn51 »

Just out of curiosity, could you post the menu.lst file that boots Puppy? It will be in the /boot/grub folder at the root of your Linux partition.

dbmix
Posts: 16
Joined: Sat 03 May 2008, 12:20

UPDATE

#6 Post by dbmix »

rcrsn51 wrote:Just out of curiosity, could you post the menu.lst file that boots Puppy? It will be in the /boot/grub folder at the root of your Linux partition.
Well, I did the unthinkable and changed two variables at once. I used the unmount command as Trapster suggested and that appeared to solve the problem. But I also commented out sections of the GRUB menu,lst file.

I tried to recreate the problem by not running the "autorun commands" and unmounting at boot, but the issue has not reappeared. It was not a one time thing as it happened about 5 times. I had even booted to windows and done a chkdsk at bootup to no avail.

The file is attached. It used to point to every partition that was ntfs as well as the primary. I commented out the extended partitions. Do you think that may have been causing it?

UPDATE - file quoted here
# GRUB configuration file '/boot/grub/menu.lst'.
# generated by 'grubconfig'. Sun May 4 22:04:01 2008
#
# Start GRUB global section
#timeout 30
color light-gray/blue black/light-gray
# End GRUB global section
# Other bootable partition config begins
title Windows (on /dev/sda1)
rootnoverify (hd0,0)
makeactive
chainloader +1
# Other bootable partition config ends
# Linux bootable partition config begins
title Linux (on /dev/sdb2)
root (hd1,1)
kernel /boot/vmlinuz root=/dev/sdb2 ro vga=normal
# Linux bootable partition config ends
# Other bootable partition config begins
# title Windows (on /dev/sdb5)
# map (hd0) (hd1)
# map (hd1) (hd0)
# map (hd0,0) (hd1,4)
# map (hd1,4) (hd0,0)
# rootnoverify (hd1,4)
# makeactive
# chainloader +1
# Other bootable partition config ends
# Other bootable partition config begins
# title Windows (on /dev/sdb6)
# map (hd0) (hd1)
# map (hd1) (hd0)
# map (hd0,0) (hd1,5)
# map (hd1,5) (hd0,0)
# rootnoverify (hd1,5)
# makeactive
# chainloader +1
# Other bootable partition config ends
title Install GRUB to floppy disk (on /dev/fd0)
pause Insert a formatted floppy disk and press enter.
root (hd1,1)
setup (fd0)
pause Press enter to continue.
title Install GRUB to Linux partition (on /dev/sdb2)
root (hd1,1)
setup (hd1,1)
pause Press enter to continue.
title - For help press 'c', then type: 'help'
root (hd0)
title - For usage examples, type: 'cat /boot/grub/usage.txt'
root (hd0)
Last edited by dbmix on Mon 05 May 2008, 21:09, edited 1 time in total.

dbmix
Posts: 16
Joined: Sat 03 May 2008, 12:20

Can SMBMount be run in this startup folder???

#7 Post by dbmix »

I am able to mount drives from the cl using smbmount, but when I try to put those commands into the rc.local file, it is a no go.
thinking that SAMBA not initialized at that point or something. Is there a place to put SAMBA commands to run automatically at start-up??

UPDATE:
Apparently at this point in the startup, Puppy is still waiting for the DHCP to respond

Thanks

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#8 Post by rcrsn51 »

Puppy 4 has a folder in the /root directory named Startup. (I don't remember if it exists by default in 3.01). Try making an executable script that contains your smbmount commands and putting it in this folder.

GeoW
Posts: 150
Joined: Tue 01 Jan 2008, 00:25
Location: New Jersey, USA ( East Coast )

#9 Post by GeoW »

Oddly enough, although Pup 3.01 has no Startup folder, if you create
one it will be used correctly. Note capital S - /root/Startup - if you put
links to your scripts into this folder, they will be run when X starts.

GeoW

EDIT
If I rem correctly it was Lobster who told me this to solve my problem.

dbmix
Posts: 16
Joined: Sat 03 May 2008, 12:20

#10 Post by dbmix »

GeoW wrote:Oddly enough, although Pup 3.01 has no Startup folder, if you create
one it will be used correctly. Note capital S - /root/Startup - if you put
links to your scripts into this folder, they will be run when X starts.

GeoW

EDIT
If I rem correctly it was Lobster who told me this to solve my problem.
...............That worked great - thanks to all!

Post Reply