Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 Jan 2020, 12:41
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to cleanly unmount your filesystem on shutdowns
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 4 [54 Posts]   Goto page: Previous 1, 2, 3, 4 Next
Author Message
nooby

Joined: 29 Jun 2008
Posts: 10548
Location: SwedenEurope

PostPosted: Fri 11 Jun 2010, 11:35    Post subject:  

Thanks,

so when you say clean you mean things one know by LED still being on or battery draining being apparent or other such things? Okay such is a good thing too.

I wish we had your knowledge on the reboot thread.
http://murga-linux.com/puppy/viewtopic.php?t=56314

_________________
I use Google Search on Puppy Forum
not an ideal solution though
Back to top
View user's profile Send private message 
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Fri 11 Jun 2010, 11:50    Post subject:  

Hmmm .....

gyro wrote:
The problem with my third machine is solved. .....

Thanks and appreciation goes to gyro for highlighting, determining and resolving his issue. I have noted down this possibility that could occur elsewhere and am currently testing a minor adjustment to cater for such condition.

Update: A fix has already been added to the rc.shutdown code block on the first page.


Rgds
Back to top
View user's profile Send private message 
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Sat 12 Jun 2010, 12:48    Post subject: 12-June-2010 update  

Hmmm .....

I've discovered a condition that prevents clean unmount on shutdowns from the command line. If one drops down to the command line (CLI), issuing a subsequent reboot/poweroff/xwin command causes bash to create a new process for these commands. This will result in a failure to detach from the puppy file system during shutdowns.

The correct execution of reboot/poweroff/xwin on the CLI requires the command exec to be used, ex:
# exec reboot

For a transparent operation, I'm recommending (more like implementing) minor changes to the reboot & poweroff scripts with additional aliases to the profile and .bashrc script. The reboot/poweroff/xwin commands will now be aliased to the proper exec statement on-the-fly.

These changes also attempts a quick fix to the running-X-from-shell issue as was described here and here.


Rgds
Back to top
View user's profile Send private message 
nooby

Joined: 29 Jun 2008
Posts: 10548
Location: SwedenEurope

PostPosted: Sat 12 Jun 2010, 14:06    Post subject:  


Thanks Patriot!







Hope I don't derail your thread too much. Is that finding that one should do exec reboot at the cli terminal console apply-able to the problem with the failure to reboot on the Toshiba Satellite in the other thread?

I mean maybe some hardware are very sensitive to how it is done. The sequence of things could be important for doing a reboot.

_________________
I use Google Search on Puppy Forum
not an ideal solution though

Last edited by nooby on Sun 13 Jun 2010, 15:27; edited 1 time in total
Back to top
View user's profile Send private message 
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Sun 13 Jun 2010, 10:24    Post subject:  

Hmmm .....

nooby wrote:
Hope I don't derail your thread too much. Is that finding that one should do exec reboot at the cli terminal console apply-able to the problem with the failure to reboot on the Toshiba Satellite in the other thread? .....

No, it is not applicable. That toshiba thingy is not related. The one suggestion that I posted earlier works for an acquaintance's toshiba satellite a couple of years back. I believe it's most likely that the acpi bios misses on some hardware stuffs on shutdowns.

Rgds
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Mon 14 Jun 2010, 03:52    Post subject:  

Patriot wrote:
A fix has already been added to the rc.shutdown code block on the first page.

Patriot's updated "rc.shutdown" solves my problem. I have now deleted the "net-cleanup" script, mentioned in my previous message.

NOTE: my tests are done on frugal installs of Puppy 431, in pupmode 12 and 13, using ext3 and ext2 pupsave files.

gyro
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Tue 15 Jun 2010, 07:11    Post subject:  

Patriot,

I just tried a fresh frugal install, no pupsave, pupmode 5.
On shutdown, after creating pupsave file, I got error messages, looked like "Device busy" on "/nroot".

I did this test booting puppy 431(+ your full rc.shutdown) off a vfat formatted SD card, so it ended up as pupmode13.

In pupmode13 every thing appeared to work, no error messages, so I kept going and connected my eth0 to the network, on shutdown still no errors. But when I checked the pupsave.2fs with fsck I get
Code:
/mnt/sdc1/pupsave.2fs was not cleanly unmounted, check forced.

gyro
Back to top
View user's profile Send private message 
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Tue 15 Jun 2010, 08:37    Post subject:  

Hmmm .....

Thanks for the report. I'll look into this soon ...

Rgds
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Tue 15 Jun 2010, 11:51    Post subject:  

Patriot,

I'm not sure if this is good news or bad news; I found our why "dhcpcd" was still running on my problem machine, but not on my good machines. Once this was 'fixed', I had no problems in pupmode12, even with the old version without "fuser".

Why did "dhcpcd" continue running on my problem machine?
In Puppy 431, there's a line in "rc.network"
Code:
      ethtool $INTERFACE | grep -Fq 'Wake-on: g' && continue
that results in "dhcpcd" not being shutdown if "ethtool" indicates "wake-on-lan" is active.
On my good machines, "ethtool" does not indicate "wake-on-lan" as active on eth0. On my problem machine "ethtool" does indicate "wake-on-lan" as active on eth0, even though it is disabled in the bios.
Solution: Comment out that line in "rc.shutdown", or do
Code:
ethtool -s eth0 wol d
before shutdown. Now "dhcpcd" gets shutdown when it should.

gyro
Back to top
View user's profile Send private message 
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Wed 16 Jun 2010, 10:49    Post subject:  

Hmmm .....

@gyro,

I've tested pupmode=5 fresh setup on a usbflash but I could not duplicate your results. In pupmode=5, the unmount code blocks have no effect on the savefile. The savefile creation is done much earlier and unmounted immediately after completion. The savefile is clean at this stage.

The error messages during pupmode=5 shutdowns were harmless as the savefile partition is also unaffected (if any, it is unmounted earlier before swapoff). Anyway, I've already adjusted the unmount code block that should cater for fresh setups and eliminate those error messages ...

gyro wrote:
.....In Puppy 431, there's a line in "rc.network"
Code:
      ethtool $INTERFACE | grep -Fq 'Wake-on: g' && continue
that results in "dhcpcd" not being shutdown if "ethtool" indicates "wake-on-lan" is active. .....

There could be a number of reasons why nic wol remains active. It could be that the nic eeprom defaults wol as enabled or whatever. At any rate, my tests with eth0 wol enabled shows that clean shutdowns is done correctly since the recent 11-June update.

Kindly check, compare and test my latest 15-June update. Also please ensure that your initrd.gz contains the init startup from tmpfs patch.


Rgds
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Thu 17 Jun 2010, 05:38    Post subject:  

Patriot,

I checked that my initrd.gz included your mods.
I did a fresh cut & paste of your mods to rc.shutdown.

I did a fresh frugal install from vfat SD card (USB storage).
On reboot, after creating the savefile, I got a couple of "umount device busy" messages. But the pupsave.2fs is good
Code:
# ./bin/fsckmount-mnt-data.sh /mnt/sdc1/pupsave.2fs
fsck 1.41.9 (22-Aug-2009)
e2fsck 1.41.9 (22-Aug-2009)
/mnt/sdc1/pupsave.2fs: clean, 337/32768 files, 11459/131072 blocks

After the reboot, now in pupmode=13, I did another reboot, and got no error messages. But the pupsave.2fs is not quite perfect
Code:
# ./bin/fsckmount-mnt-data.sh /mnt/sdc1/pupsave.2fs
fsck 1.41.9 (22-Aug-2009)
e2fsck 1.41.9 (22-Aug-2009)
Superblock last mount time (Fri Jun 18 05:12:37 2010,
   now = Thu Jun 17 19:16:48 2010) is in the future.
Fix? yes

/mnt/sdc1/pupsave.2fs was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/mnt/sdc1/pupsave.2fs: ***** FILE SYSTEM WAS MODIFIED *****
/mnt/sdc1/pupsave.2fs: 392/32768 files (0.3% non-contiguous), 11905/131072 blocks
What I find intriguing is that even though it says "not cleanly unmounted", it doesn't find any errors.
The release rc.shutdown produced a pupsave file that was not only "not cleanly unmounted", but fsck always reported some errors.

gyro
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Thu 17 Jun 2010, 05:57    Post subject:  

Patriot,

Tried your busybox.
Works fine except no "ipcalc" applet.
In puppy 431, rc.network uses "ipcalc" when setting up static IP addresses. So I've reverted to the release busybox.

gyro
Back to top
View user's profile Send private message 
Patriot


Joined: 15 Jan 2009
Posts: 734

PostPosted: Thu 17 Jun 2010, 09:14    Post subject:  

Hmmm .....

gyro wrote:
Code:
# ./bin/fsckmount-mnt-data.sh /mnt/sdc1/pupsave.2fs
fsck 1.41.9 (22-Aug-2009)
e2fsck 1.41.9 (22-Aug-2009)
Superblock last mount time (Fri Jun 18 05:12:37 2010,
   now = Thu Jun 17 19:16:48 2010) is in the future.
Fix? yes .....
What I find intriguing is that even though it says "not cleanly unmounted", it doesn't find any errors. .....

The only error there is the unmount time stamp. When the savefile is last mounted/unmounted, the time is Fri Jun 18 05:12:37 2010 but the time is now Thu Jun 17 19:16:48 2010 ... The filesystem itself is fine, this is what I call an "administrative" error .... Laughing

Nope, it's not caused by the clean unmount code blocks. This is a wider problem (TZ/UTC/localtime/whatever) that seems to affect many puppy versions. Will need a bit of time to look into ... and thanks for the busybox test report. I've uploaded a new copy of busybox with ipcalc added (minus watchdog). If you find any critical applet missing, just let me know.


Rgds
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Fri 18 Jun 2010, 11:11    Post subject:  

Patriot,
I do understand that the "mount time in the future" error message, is unrelated to rc.shutdown doing the right thing. I think it's got something to do with the mount in init being done before the localtime stuff is sorted out.

Patriot wrote:
thanks for the busybox test report. I've uploaded a new copy of busybox with ipcalc added (minus watchdog). If you find any critical applet missing, just let me know.
Thanks for the new busybox, now I can use your upgraded busybox, and still configure static IP addresses in puppy 431. I haven't missed watchdog yet.

gyro
Back to top
View user's profile Send private message 
gyro

Joined: 28 Oct 2008
Posts: 1703
Location: Brisbane, Australia

PostPosted: Sat 03 Jul 2010, 15:55    Post subject: bug in init code??  

Patriot,

I was just reviewing my code changes to the init script in initrd.gz, and I noticed something odd with your code:
Code:
# Patriot: init from tmpfs
mkdir -p /pup_new/mnt/unrootfs
mount -t tmpfs tmpfs /pup_new/mnt/unrootfs -o size=4m
cp /bin/busybox /pup_new/mnt/unrootfs/init
if [ "$(readlink /pup_new/sbin/init)" != "/mnt/unrootfs/init" ]; then
  ln -sf /mnt/unrootfs/init /pup_new/sbin/init
fi
sync
should it be
Code:
# Patriot: init from tmpfs
mkdir -p /pup_new/mnt/unrootfs
mount -t tmpfs tmpfs /pup_new/mnt/unrootfs -o size=4m
cp /bin/busybox /pup_new/mnt/unrootfs/init
if [ "$(readlink /pup_new/sbin/init)" != "/pup_new/mnt/unrootfs/init" ]; then
  ln -sf /pup_new/mnt/unrootfs/init /pup_new/sbin/init
fi
sync
i.e. adding "/pup_new" in "if" and "ln" lines?

gyro
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 4 [54 Posts]   Goto page: Previous 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1285s ][ Queries: 12 (0.0308s) ][ GZIP on ]