LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-11-2010, 07:12 AM   #1
sulekha
Member
 
Registered: Dec 2004
Location: India
Distribution: ubuntu 10.04 , centos 5.5 , Debian lenny, Freenas
Posts: 324

Rep: Reputation: 36
Question how to take the snapshot of memory in ubuntu ?


how to take the snapshot of memory in ubuntu ?
under the following situations :-

1) the application crashes
2) you close it without saving
3) you save over a doc you had just opened


my idea was to do the following

cp /dev/mem ~/memory.bin

now after copying is done you can access the file using:- less ~/memory.bin

but when i tried i am getting this

root@zodioc:~# cp /dev/mem ~/memory.bin
cp: reading `/dev/mem': Operation not permitted


Is there any other way to do this in ubuntu ?
 
Old 07-11-2010, 08:30 AM   #2
irmin
Member
 
Registered: Jan 2010
Location: the universe
Distribution: Slackware (modified), Slackware64 (modified), openSuSE (modified)
Posts: 342

Rep: Reputation: 62
Your problem is described here
http://forums.anandtech.com/showthread.php?p=29103926

it looks like, your kernel is configured to disallow accessing certain memory regions through /dev/mem. The relevant kernel config option is:
Quote:
config STRICT_DEVMEM
bool "Filter access to /dev/mem"
---help---
If this option is disabled, you allow userspace (root) access to all
of memory, including kernel and userspace memory. Accidental
access to this is obviously disastrous, but specific access can
be used by people debugging the kernel. Note that with PAT support
enabled, even in this case there are restrictions on /dev/mem
use due to the cache aliasing requirements.

If this option is switched on, the /dev/mem file only allows
userspace access to PCI space and the BIOS code and data regions.
This is sufficient for dosemu and X and all common users of
/dev/mem.

If in doubt, say Y.
Anyway, if an application crashes, take the standard approach and examine the core dump (enable with "ulimit -c 1") to extract some data about the crash. Furthermore you can attach to a running process with gdb: "gdb <executable> <pid>" and change data structures.
But I wonder how you will extract the data from the memory, if you forget to save your work. You must know the memory layout very well for this to work. Nevertheless, remember, that the physical memory layout may be different from the logical layout used by the application. For a core dump the recovery might be possible, if there are debug information available.

I currently see no other option to access the full memory from userspace.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
snapshot apps ubuntu 8.04 RON Howe Linux - Software 4 03-18-2010 12:16 AM
LXer: Creating Snapshot-Backups with BackerUpper On Ubuntu 9.04 LXer Syndicated Linux News 0 07-27-2009 07:10 AM
LXer: Creating Snapshot-Backups with BackerUpper On Ubuntu 7.10 LXer Syndicated Linux News 0 03-11-2008 11:12 PM
LXer: Creating Snapshot-Backups with FlyBack On Ubuntu 7.10 LXer Syndicated Linux News 0 02-03-2008 02:20 PM
LXer: Creating Snapshot Backups Of Your Desktop With TimeVault On Ubuntu 7.10 LXer Syndicated Linux News 0 12-20-2007 06:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 01:34 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