DUMB MOVE: sudo chown -R notroot:notroot /*

The title pretty much says it all.  I changed the owner/group of everything below / to something other than root.  Commands suddenly stopped working.
I rebooted, logged in as root and tried to make things better by performing the same command, but this time setting everything to root except for my home directory.  I'm sure not everything in the filesystem was originally set to root:root but hopefully this would get me closer to a working system.  Unfortunately sudo still wouldn't work, giving the message:
sudo: must be setuid root
I set the setuid flag on the sudo file.  Sudo now works. 
Next step... Under my usual username I tried to start X.  X no work...
Cannot move old logfile ("/var/log/Xorg.0.log" to "/var/log/Xorg.0.log.old"
So, I set the setuid flag on /usr/bin/Xorg and now X starts up great.  However, I get the feeling this setuid business might be a kludge, allowing said programs to effectively run as that program file's owner (now root).  Now, I'm thinking that the fewer things I have running as root, the better.  As such, my current fix doesn't seem ideal.
My screw-up didn't involve messing with the permissions in any way; I just changed the _ownership_ of everything in a very bad way.  So if it's an ownership issue why should I be messing with setuid flags?  Are setuid flags somehow turned off when ownership of a file is changed or is this setuid flag business just an alternate solution/workaround to my ownership problem?
More importantly, is there a reasonably painless way that I can restore all my installed packages and their associated files to their original ownerships.  This would basically be a reinstall using the list of packages I already have installed as a reference, saving me the trouble of manually selecting all my currently installed packages.  I looked at the pacman man page but nothing jumped out at me.  Any thoughts would be greatly appreciated.
Last edited by battlepanic (2009-09-22 22:02:16)

*lol* Welcome to the club - been there, done that - and it is _not_ recommended!
I believe I resorted to a reinstall in the end - it just caused too many problems.
So take a bite out of the sour apple, back up your home directory and do a complete reinstall.
And ... I bet you 10 to 1 you aren't gonna do the same again - ever!!

Similar Messages

  • Unhappy sudo chown -R myuser /

    hi
    have mistaken performed a
    sudo chown -R myuser /
    on my macbook...
    now it claims it cannot load several kexts like:
    /system/library/extensions/system.kext/plugins/mach.kext
    /system/library/extensions/system.kext/plugins/libkern.kext
    /system/library/extensions/system.kext/plugins/unsuported.kext
    /system/library/extensions/system.kext/plugins/bsdkernel.kext
    /system/library/extensions/system.kext/plugins/iokit.kext
    /system/library/extensions/autofs.kext
    I need to repair the default permissions....but disk utility already said i cannot repair the disk due to this error:
    the underlying task reported failure on exit
    already tried to repair using the install dvd too.
    found on the web this procedure:
    Boot off the OS X CD (reboot, hold C while booting).
    The installer will load up, go to Utilities in the menu and run Terminal.
    Type df and look for the drive that has your Mac system mounted---you'll have to unmount this. On my MacBook Pro, it was /dev/disk0s2.
    Type umount /dev/disk0s2, replacing disk0s2 with whatever disk your OS lives on.
    Type fsck_hfs -r /dev/disk0s2. If you umounted the wrong thing, it will complain that you can't repair a mounted drive. Go back and umount the right thing and repeat this step.
    (they forgot to add the step to re-mount...but its ok..)
    and this one:
    Single user mode (boot with -s) and then type
    fsck_hfs -r /dev/volumename
    will any of those save me from a archive and install?
    HELP!! Those warnings cannot be good... but the system is booting and working fine till now.
    thanks

    biovizier wrote:
    Oh come on, it isn't exactly rocket science. Compare actual permissions to expected permissions and correct discrepancies, while making allowances for a few special cases. The 'chmod -R' command does {sic} move or alter any files, it just changes the permissions so I think it falls well within the realm of what "repair permissions" should be able to handle (but I'd bet it would be faster just to reinstall).
    Rocket science is not required to understand that with the "-R" option applied to the root level of the startup drive this isn't something that the permissions repair utility (in any version, old or new) is capable of repairing. That option is the command line equivalent of the Finder's "Apply to enclosed items" option, so the command affects every file in the entire filesystem hierarchy!
    At best, the utility can reset permissions only of files with entries in the receipts database -- it is the only place expected permissions are stored -- & if a user acting with superuser privileges clobbers access to that, the OS is going to make those changes, even if it means making the receipts folder unavailable to the routines that must access it. The idea that the OS should 'make allowances' for that special case is ridiculous -- it is tantamount to the idea that there should be a 'super-duper-user' built into the system that prevents users willfully acting with superuser privileges from doing anything foolish.
    Apple doesn't need an excuse to leave things as they are. They are that way because the permissions repair utility is not, never has been, & never will be the panacea for every permissions issue that a few users seem to think it should be. As far as I can tell, the only basis for that idea is a superficial examination of the name of the utility, some wishful thinking, & more than a little disregard for what is impractical, if not downright impossible, to implement in a general purpose, UNIX-based OS.
    Anytime any user invokes sudo, they should remember the time-tested warning that *with great power comes great responsibility*. In one form or another, that warning has been around for at least 2000 years. It is no less true today. There is no need for anyone to apologize for the fact that not even Apple has found a way around it!

  • Wrong ownership on TM-- is it safe to 'sudo chown -R user Time-Machine ?

    I ran Migration Assistant by a new user "Admin" to recover the accounts of 3 users on Lion.
    After the migration, Admin owns the Time Machine history of one of the users (even though account Admin didn't even exist at the time these backups were made).
    Is it safe to run:
        sudo chown -R alex "/Volumes/Time-Machine/Backups.backupdb/Alex's MacBook/*/Macintosh HD/Users/alex"

    I ran Migration Assistant by a new user "Admin" to recover the accounts of 3 users on Lion.
    After the migration, Admin owns the Time Machine history of one of the users (even though account Admin didn't even exist at the time these backups were made).
    Is it safe to run:
        sudo chown -R alex "/Volumes/Time-Machine/Backups.backupdb/Alex's MacBook/*/Macintosh HD/Users/alex"

  • Sudo chown + chmod on system drive?

    Hello,
    Before I mess my system drive up I wanted to check if this is ok.
    For various reasons I have created a new Account that I wish to migrate to. I log in ok and can change permissions but there seem to be files on various places that I keep having to set permissions for and wish to resolve this for the whole drive.
    What I want is a way to set permissions on all non system files to add admin access as it appears it is not there for certain files
    I found the below commands which worked on my media drive but am reluctant to run it on the system drive:
    sudo chflags 0 /Volumes/System
    sudo chown 0:80 /Volumes/System
    sudo chmod 775 /Volumes/System
    sudo chmod -N /Volumes/System
    I think the one above should have the "R" in as below to do this recursivly ?
    sudo chmod -RN /Volumes/System
    I don't want to mess up the system drive so I thought I should check if this is ok or not. I think some system files need to be read only so I need to know if this will render the drive useless(I do have a full backup).
    I also see people recomend Batchmod but am again unsure if this will work or what settings to use?

    Thanks Niel,
    I have read numorous posts from yourself and V.K. relating to locked secondary drives but nothing relating to system drives and fully expected that answer. can I bother you a bit more please?
    Can I safly run those commands on some of these folders?
    system\users\olduseraccount
    System\library\application support
    System\library\audio
    I think that would solve most issues there are hundreds of folders with presets from plugins that have installed with only my old account as read write not admins?
    Thanks again Niel
    Ross

  • Executed "sudo chown -R admin /" by mistake. how do i check everything?

    So "sudo chown -R admin /" was executed by mistake on an OSX 10.8.5 machine that's connected with a multiuser network. In addition to screwing up the local machine, it may have effected many other things since / includes /Network, /Volumes, possible non-Mac mounts, etc.
    I was looking in system.log, and it doesn't show which files had their permissions actually changed. Is there any log on the machine where the command was executed, which lists all the files under / that chown was applied to before it was stopped? And would it show what the ownership was changed from? I'd like to go through that list and know the extent of the damage.
    Thanks.

    There is no log for that operation. Boot into your recovery volume and run Repair Permissions. It will take a while. You will have to re-run that command with the appropriate user on each user home directory. Some applications, particularly those that use DRM, will be scrambled and will have to be reinstalled. After repairing permissions and fixing the users, login as a user and try to run the expensive applications. Any that need reinstallation will alert you to that fact.

  • Help please re: a dumb move

    Hello, I managed to have the system track my iphone as an intruder and then kicked it off the network.  (in my defense it previously showed it as an iphone and for some reason it was showing as an unkown guest)  Anyway, now my iphone cannot use the wireless service as it says "Unable to join network"  Any tips on how to undue this dumb move?  I'd very much aprecciate any help you could provide!  ~Terri
    Solved!
    Go to Solution.

    Well, I tried alot of things. but the one that I believe did it in the end was simply requesting the network on my iphone using the network name and password.  Simple solution that took me hours to figure out.  I am not sure whether that would have worked however without completely uninstalling and reinstalling the cisco software and resetting the router.  I'd try the iphone thing first, it took only a minute.  Good luck, I hope it works for you! 

  • Dumb move, help needed

    I did the obviously dumb move of overwriting index.html with an older file and now I need to know if there is any way at all of rollingback the change?  The site is maintained with Contribute, I do my updates/changes (remotely) in Dreamweaver. I do not have Contribute installed, the website's owner uses Contribute to make her changes.  We are in different locations so I am trying to avoid having to drive there to look for the older file on her computer.  UGH.  Totally dumb, I know, but at this point I am just hoping there is a way to fix the problem with rollbacks or something of the like.  I am willing to buy Contribute if need be. I totally appreciate any suggestions -Thanks.

    Here's a link to your Jan 25th version
    http://webcache.googleusercontent.com/search?q=cache:EGL6vfh_g74J:www.mountain.santacruz.k 12.ca.us/+&cd=1&hl=en&ct=clnk&gl=us

  • TOO MANY INQUIRIES - Chase Freedom - Dumb move :-/

    Let me preface by saying I made a dumb move today.  I am in the rebuilding phase still, and I applied for CHASE Freedom, and Barclay Rewards - both denied even on Recon. I got excited because my scores bumped from mid-500s 2 months ago to 600-610 across the board. . stupid move. I now have 6 inquiries in the past 60 days, a total of 11 since January. So far my scores have not taken any hits from INQ .. What are the odds I'll see a big dip? Or any dip at all? On a positive note, my UTIL has been lowered from 81% to 40% which will all update by 8/3 .. so that should hopefully help my score rebound, or at least cancel out one another. I am officially gardening until the New Year!!! I even put freezes on my burueas after the denials. I dont need judgment, just advice. :-) My scores 2 months ago were: TU 555 EX 560 EQ 540, as of today TU 600 EX 610 EQ 602. No lates in one year's time, 2 medical collections aging off soon. I almost have an addiction to applying for credit, and I got overly excited last month with my new approvals for CAP ONE (after charge off 2.5 years ago) for $1,000 lines. . Hence the freezes and GARDENING. Any advice would really help .. I am afraid of a large score dip with 2 new inquiries on top of the 4 I already had in just 60 days, even though I saw no dip last time. Go forth, credit kings !

    Joeyzoom416 wrote:
    Let me preface by saying I made a dumb move today.  I am in the rebuilding phase still, and I applied for CHASE Freedom, and Barclay Rewards - both denied even on Recon. I got excited because my scores bumped from mid-500s 2 months ago to 600-610 across the board. . stupid move. I now have 6 inquiries in the past 60 days, a total of 11 since January. So far my scores have not taken any hits from INQ .. What are the odds I'll see a big dip? Or any dip at all? On a positive note, my UTIL has been lowered from 81% to 40% which will all update by 8/3 .. so that should hopefully help my score rebound, or at least cancel out one another. I am officially gardening until the New Year!!! I even put freezes on my burueas after the denials. I dont need judgment, just advice. :-) My scores 2 months ago were: TU 555 EX 560 EQ 540, as of today TU 600 EX 610 EQ 602. No lates in one year's time, 2 medical collections aging off soon. I almost have an addiction to applying for credit, and I got overly excited last month with my new approvals for CAP ONE (after charge off 2.5 years ago) for $1,000 lines. . Hence the freezes and GARDENING. Any advice would really help .. I am afraid of a large score dip with 2 new inquiries on top of the 4 I already had in just 60 days, even though I saw no dip last time. Go forth, credit kings !You are doing the right thing now....Time to garden...

  • Sudo chown root:admin / command information

    I would like to know if the use of this command before an OSX update would affect the operation of my computer after the 10.6.7 update. I had to use this command (suggested by vea1083) to fix a directory ownership disassociation following the iTunes 10.2.1 Update which slowed my MacBook Pro boot up speed by twice of the time. The following command was used to fix the issue and it worked successfully:
    *sudo chown root:admin /*
    Thank you for any assistance in this matter.

    Thank You for your responses, besides noticing that my thread has been moved to another forum let me give you a little insight on my decision to call in this command in the terminal window.
    It all started 1 month ago, I performed an iTunes update and to my surprise, my boot time went up from 22 seconds to almost 50 seconds. I cleared my log in items and repaired my permissions, with no success, so I had to take the sledgehammer approach and reinstall OSX and get the combo update to bring back my computer to OSX 10.6.6, after performing the reinstallation, my boot time went back to normal (22 seconds). Thinking that this was only a one time issue, when iTunes 10.2.0 came out I performed the iTunes update and again I was presented with the slow boot up issue after updating iTunes, angered by the fact that the same issue resurfaced, again I performed another permissions repair and reboot, and using my Mac in Safeboot mode failed, I had to again reinstall OSX again. Now hopeless, when the iTunes update 10.2.1 update came out, I did again the freaking update and boom again the same problem only this time I refused to reinstall OSX (I deny to see myself reinstalling OSX every single time I had to update iTunes). Fortunately I found a fix candidate in this Macrumors thread (http://forums.macrumors.com/showthread.php?t=1109887) where some MacBook Airs were reporting a similar boot time slowdown after the users performed an iTunes Update. Here was there where one user got the suggested the *sudo chown root:admin /* command:
    http://rifers.org/blogs/gbevin/2009/9/20/slowstartupshutdownsnowleopard
    I had hold off my 10.6.7 update pending a before update permissions fix and time machine backup to keep my computer from running into more troubles that I am already had.
    Thank you for your understanding and suggestions

  • [SOLVED] I did a dumb thing... (chmod/chown)

    Hi all, hope this is the right section,
    So I decided that I was tired of authenticating when I wanted to change some files for my SLiM theme, and decided to add permissions to my user.. on the entire share folder. Well, here's what I ran:
    [naut@arch /usr]$ sudo chown -Rv root:naut share/ && sudo chmod -Rv 664 share/
    Yep. So after I did that I noticed that xfce stopped working properly; all of my icons, panels, etc, were showing as follows: ▖▖▖▖▖▖▖▖▖▖
    I immediately tried to revert the change my chowning back to root:root, and setting most files back to 644, but it had no effect. I logged out and logged back in to see if it was a temporary thing, but when I logged back in, even more items were showing ▖▖▖▖▖▖▖▖▖▖. I switched to another tty and chmoded all of /usr/share to 777... now I know that's generally a bad idea but when I logged back in, I did see that it at least went back to normal functionality.
    So my question becomes, how can I know what dirs/files need what permissions? I'd like to get it back to where I have the least permission required for everything to work properly.
    Last edited by naut (2014-05-09 14:56:16)

    644 broke things because directories need execute permissions to be traversable.
    Unfortunately, /usr/share is a grab-bag of permissions:
    # find /usr/share -type f -exec ls -l {} + | cut -d ' ' -f 1 | sort | uniq -c
    2879 -r--r--r--
    4 -r-xr-xr-x
    49229 -rw-r--r--
    12 -rw-r-xr--
    143 -rw-rw-r--
    277 -rwxr-xr-x
    3 -rwxrwxr-x
    You'd probably be safe enough to set all files to 644 and all directories to 755, but you might want to check with pacman -Qkk and reinstall any packages that complain about permissions mismatches. This won't fix everything though, as some packages still pre-date MTREE files.

  • How do I move all my files from one User Profile (account) into another? I needed to create a new account and want all of my files accessible in the new one.

    How do I move all my files from one User Profile (account) into another?
    I needed to create a new account and want all of my files accessible in the new one.

    ok, what you're learning right now is 101 unix, which is good. Unix is a good thing
    now: the way unix works, and macos (which uses unix underneath) the files and folders work like a hierarchy.
    the start of that tree is /
    so, if you were to do:
    cd /
    (cd means change directory)
    it will bring you at the highest branch of the file system.
    cd /Users
    will bring you to where all the users are.
    to see whats in /Users you can use your friend ls command
    ls means list files/directories
    so:
    cd /Users
    ls -la
    (the -la here means show all (even hidden) and long format (very verbose))  this flag is very optional.
    you will see
    fred
    user2
    for example.
    if you want to see the desktop of user2 you would change directory to it then list the files.
    for example:
    cd /Users/user2/Desktop
    Note that the files and directory are case sensitive, so, desktop is NOT the same as Desktop, or DESKTOP
    ls -la
    you should then be able to see everything in users2 desktop
    you could have done as well the same thing in smaller steps, for example:
    cd /
    cd Users
    cd user2
    cd Desktop
    this is the equivalent of cd /Users/user2/Desktop
    So, for your file, i don't know where it was, but know that if you log in as user2, it will directly put you in
    /Users/user2
    which most likely the file you had created from the other user was in /Users/user1
    if you copied all the files from /Users/original_user to /Users/secondUser
    most likely yes, all your mail, bookmarks etc would be copied over.
    so in your case.
    sudo chown -R seconduser:staff /Users/secondUser
    should work
    Remember that if you start a path with the character /  it means start from the root of the file system, at the highest top you can ever get.
    so
    cd /Users/fred
    is not the same as
    cd Users/fred
    unless you were in / already
    i know it may be confusing at first but it's actually very logical if you play with it.
    to simplify, think of it that / means C:\  on windows
    you can't go any higher than C:\  (in a way)
    if you're unsure which directory you're currently in, you can always type:
    pwd
    it will tell you where you are.
    for example:
    cd /
    pwd
    this shows  /
    cd Users
    pwd
    this now shows /Users
    cd /System/Library
    pwd will show /System/Library
    cd /
    cd /Users
    cd fred
    cd Library
    pwd will show /Users/fred/Library
    unix can look very scary but it's actually vital and very necessary to do tasks sometimes that would take for ever to do via the windows. This is good learning.
    so for the myfile you had created, i can't tell you where it is, at the time you created, if you can do a pwd command you'll know the path,
    ls -la  (this shows all the files where you are)
    if you see myfile in the list
    do a pwd
    whatever is return, the real location of the file would be:
    whatever pwd returned / myfile
    I hope that makes sense.

  • When I move items to the trash they do not go into the trash, they are deleted entirely

    Heading above pretty much explains it.  Sometime recently, my trash started acting differently - when I attempt to move an item into the trash, I get a message asking if I want to delete the item permanently.  I am sure this is a fairly new phenomenon.

    Click on the item in the Finder's sidebar with the house icon and verify that you are able to write to this folder in the Sharing & Permissions section of the Get Info window, and that it isn't locked; if it is already set this way and you get that error, open the Terminal in the /Applications/Utilities/ folder and run the following:
    mkdir ~/.Trash
    If you get a message stating that the folder exists, run the following:
    sudo chown $UID ~/.Trash
    chmod u+rwx ~/.Trash
    The first command in the second set will prompt you for your administrator password; nothing will appear in the Terminal window while it is being typed. In either case, click on the Finder icon in the Dock with the Control and Option keys pressed, and relaunch it.
    (79947)

  • I can't move files or folders or delete files without authentication. Also, it doesn't appear that I can change permissions?

    I can't seem to move or delete files or folders on my MacBook Air mountain lion system. It doesn't appear that changing permissions works either? Any ideas?

    Back up all data now.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Drag or copy — do not type — the following line into the Terminal window, then press return:
    sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:20 ~ $_ ; chmod -R -N ~ $_ 2> /dev/null
    Be sure to select the whole line by triple-clicking anywhere in it. You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. You don't need to post the warning. If you don’t have a login password, you’ll need to set one before you can run the command.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select Utilities ▹ Terminal from the menu bar. A text window opens.
    In the Terminal window, type this:
    resetpassword
    That's one word with no spaces. Then press return. A Reset Password window opens. You’re not going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • Suddenly I can't move files to trash, whe I try to drag them to it there is a cirle with a diagonal line across. HELP!

    Suddenly I can't move files to trash, whe I try to drag them to it there is a cirle with a diagonal line across. HELP!

    Back up all data. Don't continue unless you're sure you can restore from a backup, even if you're unable to log in.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line on this page to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password. Nothing will be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1 or if it doesn't solve the problem.
    Boot into Recovery. When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • Movie from ram

    I wrote a little script which plays copies movie into RAM and plays it from.
    Requirements:
    - packages:
           mplayer
           bar(optional, can be replaced by normal cp command, bar is used only to show progress of coping to RAMfs)
    Preparation (replace "USER" with the username which will play the movie):
    1. A line in fstab is needed:
    none /mnt/ramfs ramfs noauto,user,maxsize=705000 0 0
    (size of the ram filesystem is set in maxsize, it would be the maximum file size of a move which you can play)
    2. Use visudo to add privilages for the user playing the move:
    USER ALL=NOPASSWD:/usr/bin/sdparm --command=stop /dev/sda
    USER ALL=NOPASSWD:/bin/chown USER /mnt/ramfs
    3. Create a file and paste the source (for example to file mplayerRamFs).
    4. Set runnable:
    chmod +x mplayerRamFs
    Some pros and cons of using this script:
    5. Start your favourite terminal program and run:
    ./mplayerRamFs movieName
    (You must specify only the name of the file without the file extension. Only .avi files are supported by this script, but it's not a big problem to change it. It's made so only to support copying subtitles.)
    Pro:
    + saves your laptop battery (not yet tested how much saves, but a movie about 1,5h long takes 39% of my battery, using laptop-mode and cpufreqd, I'll write how much it saved after I watch a movie today :D )
    Contra:
    - needs at least 1GB of RAM
    Source:
    #!/bin/bash
    #set -x
    echo Preparin to play movie from RAMfs: $1
    if [ "`free -m|awk '/Mem:/ {print $2}'`" -lt "999" ]; then
    echo "Not enough RAM!"
    echo "At least 1GB is needed!"
    exit 1
    fi
    echo Mounting ramfs..
    mount /mnt/ramfs || exit 1
    echo Setting permissions...
    sudo chown macieks /mnt/ramfs || exit 1
    echo Copying movie to RAMfs...
    bar -o /mnt/ramfs/"$1.avi" "$1.avi" || exit 1
    # if you don't have bar, use cp instead:
    #cp "$1.avi" /mnt/ramfs
    cp "$1.txt" /mnt/ramfs 2> /dev/null
    echo Running mplayer in background...
    mplayer -fs -vo sdl "/mnt/ramfs/$1.avi" && umount /mnt/ramfs || umount /mnt/ramfs &
    echo Waiting 30 secs to spin down the disk...
    sleep 30
    # Use here any other method you want (sdparm, hdparm)
    sudo sdparm --command=stop /dev/sda
    What do you think about this idea? Mayby someone has other better/simplier solution?
    PS.
    To reduce memory and disk usage, I run startx from console. In /etc/X11/xinit/xinitrc I only have twm started.
    Also before starting the script it's good to stop all daemons from DAEMON list in rc.conf.
    Ofcourse except acpid, cpufreqd, alsa, network, powersaved, laptop-mode (and similar).
    Important is to stop syslog-ng, because it's often a reason to spin up the disk.
    (I'm thinking of adding a function to stop all the daemons before playing the movie and starting them after that)
    Last edited by MAC!EK (2007-07-10 11:22:05)

    nikron wrote:Doesn't it use the same amount of power since you read the entire movie into ram anyway?   Or is reading it all at once better?
    Well, that depends. Power efficiency with cdrom drives is in fact a little tricky to calculate. For one you have CBR modes/speed, which means the drive spins the disc at a rate that gives a constant performance and if that matches your movie bitrate, it depends on how much loss the motor etc. produces but generally you could say this is the optimum of efficiency when playing a movie directly from cd. If you can't match it perfectly because your drive doesn't support that particular speed in CBR it's probably a better idea to copy the movie first.
    With DVDs though, this has changed a little. Basicly every drive can do DVD 1x where 1x is exactly the speed necessary to play a standard DVD. It's hard to beat the efficiency here. It's probably going to turn out just the same.
    Last edited by kth5 (2007-07-17 05:17:08)

Maybe you are looking for

  • Officejet 6700: how do I install Help after I have installed everything else.

    1. HP Help for my unit doesnt seem to be installed on my laptop running Mac Mavericks.  I had to run the CD to learn how to turn on/off 2-sided printing (duplexing).  Where do I look to find whether or not Help was installed when I installed everythi

  • Sending/Reading custom Strings in HTTP Header

    Hey people, I'm developing a J2ME application in which I'm trying to send a Message object (a few Strings such as Content, Nickname etc) to a Servlet. Serialization would be nice but since J2ME doesn't support it, I would have to come up with a custo

  • Cannot browse to Outlook webmail - Firefox, Mac

    I have Firefox 35.0.1 and OS X Yosemite 10.10.1 On Firefox, I cannot browse to webmail.oxfam.ca.  I can do so on Safari on the same computer but on Firefox, the wheel just spins, Connecting... and eventually it times out and I get a blank page with a

  • OSB Service Callouts - HTTP Threads

    Hi All, We are having issues with OSB service callouts calling the business services from the Proxy Services. Due to excessive usage of Service Callouts, the proxy services are hanging out in the OSB server. From the Proxy services,we could able to s

  • I am trying to change my security questions but cannot remember previous answers

    I am trying to change my security questions but cannot remember previous answers it is asking me for, is there a way to reset these answers and insert new ones?