LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-14-2006, 12:47 PM   #1
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Lightbulb TIP: How to check system changes in advance


Thought I'd pass on a tip for new users or those unfamiliar with unionfs.

It's great for pre-checking what changes will be made to your system. For example, I recently installed some things (manually compiled) and the instructions said you must run as root. It was not obvious why this was necessary, so I used unionfs to see what the installation would do with it's root permissions before I actually modified my system. Make sure to set / as readonly on the unionfs mount command, and don't forget to do the chroot!
Code:
$ su -
# mkdir /var/write-layer
# mkdir /var/fake-root
# mount -t unionfs -o dirs=/var/write-layer:/=ro none /var/fake-root
# chroot /var/fake-root
# *** Do whatever you want as root, all updates will be to /var/write-layer ***
# *** Leave the chroot environment with a call to "exit" ***
# exit
# rmdir /var/fake-root
# cd /var/write-layer
# *** Look around to see what has changed, make sure to list hidden files ***
# *** A hidden file named like ".wh*" is a "whiteout" (deletion) file ***
# rm -rf /var/write-layer
# exit
$ exit
Note: You're logged in as root, and root can break out of a chroot jail, so this is not meant to test things that might try to escape chroot for malicious purposes!
 
Old 07-14-2006, 01:40 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
Great tip.
Makes me think that this would be a good way to build packages.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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



Similar Threads
Thread Thread Starter Forum Replies Last Post
An error Occurred during the file system check. Dropping you to shell; the system wil aneikei Linux - Newbie 3 02-11-2010 07:38 PM
Tip: The parts of a Linux system sundialsvcs Linux - Newbie 7 08-14-2005 11:50 AM
System freezes... what should I check first? QCompson Linux - General 1 11-12-2004 01:36 PM
What to Check to make sure system is OK asmith1972 Linux - Newbie 7 05-20-2004 07:13 AM
How to check what is your file system? Alinuxnoob Linux - Newbie 2 03-31-2002 01:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration