Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


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

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
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!
$ 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
Senior Member
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

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


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 > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:34 PM.

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