LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 08-16-2012, 08:50 PM   #1
penyu
LQ Newbie
 
Registered: Oct 2007
Posts: 3

Rep: Reputation: 0
how to backup ramfs or tmpfs using dd


Hi All,

I have problem with backup ramfs/tmpfs to solid/regular disk.

I prefer backup those ramfs/tmpfs using "dd" command instead of "cp" command, so I don't need care about a lot of files, contain of files/dirs and permissions.

as I know backup using dd need two params: origin disk/file and destination disk/file. disk usually identified by something in /dev.

for ramfs/tmpfs I dont know how to dealing with, since I cannot found those type of disk/file under /dev nor dmesg.

Code:
root@debian:/etc# cat /etc/fstab
...........
none    /mnt/tmpfs      tmpfs   size=1G 0       0
root@debian:/etc# mount -a
root@debian:/etc# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             953M  702M  203M  78% /
tmpfs                 1.5G     0  1.5G   0% /lib/init/rw
udev                  1.5G   96K  1.5G   1% /dev
tmpfs                 1.5G     0  1.5G   0% /dev/shm
none                  1.0G     0  1.0G   0% /mnt/tmpfs
root@debian:/etc#
do somebody ever had this similar cases?

really appreciated for your kind of answers.
BR//Den
 
Old 08-17-2012, 01:02 AM   #2
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 116Reputation: 116
ramfs/tmpfs are for ephemeral data. If you need to back it up, you should not be putting it in ramfs/tmpfs. Ordinary filesystems for physical block devices do sufficient caching that you should get near ramfs speed if you have enough free RAM. And they are inherently backed up via their backing store (do "sync" to be sure at given points in time). Let the OS take care of this for you unless you have an odd case (tell us about it, if so).

I have used ramfs or ramdisk in lieu of a disk to avoid the disk I/O in some cases (example: I did a Slackware install in a VM based entirely on a ramdisk in much less time than doing so on a real disk in a real machine). I copied the image to disk afterwards. If it didn't finish, that data was of no value.
 
Old 08-17-2012, 03:09 AM   #3
penyu
LQ Newbie
 
Registered: Oct 2007
Posts: 3

Original Poster
Rep: Reputation: 0
well thanks Skaperen,

actually my goal is only during software operations, to speed-up process and data reads, that why I need this method.
but, due to some data may be needed in another operations, I will need those data stored fast.

I prefer doing all that things in memory, rather than physical disc.

any workaround please welcome..

BR//
 
Old 08-17-2012, 06:21 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,561
Blog Entries: 54

Rep: Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927Reputation: 2927
Quote:
Originally Posted by penyu View Post
I prefer backup those ramfs/tmpfs using "dd" command instead of "cp" command, so I don't need care about a lot of files, contain of files/dirs and permissions.
As for method, why not use rsync instead? Like
Code:
rsync -rSW /mnt/tmpfs/ /path/to/backup/tmpfs/
 
  


Reply

Tags
backup, tmpfs


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
/etc/fstab "tmpfs /tmp tmpfs defaults 0 0" ramfs?! HOW? xcislav Linux - General 2 06-04-2011 04:03 AM
Running Slackware from an SD card - tmpfs / ramfs disturbed1 Slackware 2 01-16-2011 12:39 AM
TMPFS, RAMFS and BSDs MFS sleeper0110 Linux - General 1 04-08-2009 01:50 PM
ramfs & tmpfs hadyy Linux - General 2 12-25-2007 03:16 PM
tmpfs and ramfs jatho Linux - General 0 06-23-2004 05:11 AM


All times are GMT -5. The time now is 11:58 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration