Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Lion softupdates

Lion softupdates
Thread Tools
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 11, 2011, 04:14 AM
 
I don't know if this has been posted before, but I just noticed that Lion supports softupdates, that is automatically running fsck on the live filesystem (it is running as I write this). FreeBSD supports this feature as well, and I guess this helps solve the debate of whether this is a safe thing to do or not.

The problem is my system is being ground to a halt while this is running...
     
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
Oct 11, 2011, 04:26 AM
 
What? fsck runs on the live boot drive now? What's it running for, and how do you know it is running?

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Oct 11, 2011, 05:11 AM
 
Are you sure? I can only check my boot volume's filesystem for errors in Disk Utility, but not repair it.
I don't suffer from insanity, I enjoy every minute of it.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 11, 2011, 07:37 AM
 
Originally Posted by OreoCookie View Post
Are you sure? I can only check my boot volume's filesystem for errors in Disk Utility, but not repair it.

That's not how softupdates work.

$ ps aux | grep -i fsck
besson3c 32783 0.1 0.0 2434892 472 s000 R+ 3:14AM 0:00.01 grep -i fsck
root 32743 0.0 12.6 2961388 528388 ?? Us 2:55AM 1:12.11 /sbin/fsck_hfs -f -n -x -E /dev/disk5
with softupdates fsck runs automatically as a background process. In FreeBSD this is invoked at boot when a disk is not marked as clean, but in Lion I suspect that this is a launchd maintenance job that runs periodically.

http://en.wikipedia.org/wiki/Softupdates
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 11, 2011, 07:47 AM
 
I take it back, it isn't softupdates...

-f = force running even on a clean system
-n = don't repair any damage found
-x = output in XML
-E = exit if any major errors are encountered

I should have also noticed that it is running on /dev/disk5, which is not my boot disk. I'm looking into what this volume is, my Time Machine volume is /dev/disk4.
( Last edited by besson3c; Oct 11, 2011 at 08:04 AM. )
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Oct 11, 2011, 07:50 AM
 
Originally Posted by besson3c View Post
I don't know if this has been posted before, but I just noticed that Lion supports softupdates, that is automatically running fsck on the live filesystem (it is running as I write this). FreeBSD supports this feature as well, and I guess this helps solve the debate of whether this is a safe thing to do or not.
Do you have any evidence that Lion uses softupdates? Not that I don't believe you, but I'd like to verify it. I never bothered reading up on how they work, and I'm to sleep-deprived to make sense of that Wiki article right now.

Originally Posted by besson3c View Post
The problem is my system is being ground to a halt while this is running...
This I don't understand. What little I do know of softupdates imply that they should cause less writes and better performance rather than worse.
The new Mac Pro has up to 30 MB of cache inside the processor itself. That's more than the HD in my first Mac. Somehow I'm still running out of space.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 11, 2011, 07:53 AM
 
I haven't figured out what /dev/disk5 is supposed to be, but while rummaging around I found something else interesting:

$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *250.1 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 249.2 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *7.4 MB disk1
1: Apple_partition_map 32.3 KB disk1s1
2: Apple_HFS Flash Player 7.3 MB disk1s2
/dev/disk4
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *665.2 GB disk4
1: Apple_partition_map 32.3 KB disk4s1
2: Apple_HFSX Time Machine Backups 665.2 GB disk4s2
There's a device node for Flash Player? Huh?
( Last edited by besson3c; Oct 11, 2011 at 08:08 AM. )
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 11, 2011, 08:02 AM
 
Originally Posted by P View Post
This I don't understand. What little I do know of softupdates imply that they should cause less writes and better performance rather than worse.

softupdates in FreeBSD are an alternative to a file system journal, they work with FreeBSD's boot file system UFS (ZFS is also supported in FreeBSD, but not as a boot drive). Whereas a journal will replay at boot time when a machine is not shut down properly, softupdates do not block the boot process like a journal such as HFS+'s journal does and instead starts running once the OS has finished booting. How fsck manages to correct stuff on a live OS I don't understand, this is the magic of softupdates. There is some debate whether this is a bulletproof scheme for repairing file systems.

In FreeBSD manually running fsck on the live OS doesn't work, there is something about the FreeBSD kernel and how softupdates are invoked at boot time that enables this. It's funky.

I know that Time Machine will fsck volumes, but as you can see from my partition listing my Time Machine volume is not /dev/disk5, my Time Machine backup was not running at that time, and I don't understand why OS X is simply verifying and not repairing this volume.

I wonder if the new Lion recovery volume periodically clones itself to /dev/disk5, fscks, and compares checksums to the recovery partition on the boot disk? This would ensure that that recovery volume is always sound. It would seem like something like this would be needed, since it is a slice on the main boot disk that is being constantly updated.
     
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Oct 11, 2011, 09:37 AM
 
It's been a while since I've read something about the anatomy of Softupdates. But to my understanding, Softupdates are not implemented by running fsck in the background, they are just well-coordinated writes that make sure the filesystem is always in a consistent state. (It's been a while, I've read technical articles about it when it was released, but that was years ago.)
I don't suffer from insanity, I enjoy every minute of it.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 11, 2011, 03:03 PM
 
Oreo, trust me, on a FreeBSD system on reboot when you haven't shut down properly, you will find fsck running as a process visible with your ps command. Try it if you don't believe me!
     
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
Oct 11, 2011, 05:44 PM
 
@besson
I know. Softupdates allow you to run fsck on a »running« system, i. e. you no longer have to boot in whatever single-user mode is called on FreeBSD (it's been a while, I had a FreeBSD 5 server running a few years ago to backup my parent's data). Softupdates ensure that the filesystem is always in a consistent state and running fsck only cleans up the mess after a crash.
I don't suffer from insanity, I enjoy every minute of it.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Oct 11, 2011, 05:51 PM
 
Originally Posted by OreoCookie View Post
@besson
I know. Softupdates allow you to run fsck on a »running« system, i. e. you no longer have to boot in whatever single-user mode is called on FreeBSD (it's been a while, I had a FreeBSD 5 server running a few years ago to backup my parent's data). Softupdates ensure that the filesystem is always in a consistent state and running fsck only cleans up the mess after a crash.

Oh, I see what you mean... I was trying to say that I believe that running fsck on the live system after it has been fully booted after a crash is a property of softupdates.

I'm still enamored by running multiple drives and self-healing, I hope that this is the direction Apple heads towards...
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 05:54 PM.
All contents of these forums © 1995-2015 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2015, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2