LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-03-2015, 08:57 AM   #1
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 656

Rep: Reputation: 35
Question Moving /tmp to RAM? Moving system from USB keydrive to SD card?


Hello

I have a couple of questions about running Debian on an ARM appliance:

1. To avoid wearing out flash memory, I'd like to move /tmp from the flash memory to RAM: Is it a good idea, and if yes, how should I proceed?*

2. The system is currently booting and running off a USB keydrive and I'd like to move it an SD card wihtout going through the whole setup again: Can I copy it from the USB keydrive to the SD card? How should I do this?

Thank you.

* Here's the infos about the device:

Code:
# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=63461,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=51512k,mode=755)
/dev/disk/by-uuid/a82663a4-cc9d-4551-b1a3-704eccf43343 on / type ext4 (rw,relatime,errors=remoun            t-ro,user_xattr,barrier=1,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=147240k)
/dev/sda1 on /boot type ext2 (rw,relatime,errors=continue)

# blkid
/dev/sda5: UUID="a30ad772-7f50-43ee-ad2b-32aedbb1abce" TYPE="swap"
/dev/sda1: UUID="fa73e058-e340-4ebc-ad94-30fddfd9fdfd" TYPE="ext2"
/dev/sda2: UUID="a82663a4-cc9d-4551-b1a3-704eccf43343" TYPE="ext4"
/dev/mmcblk0p1: LABEL="SHEEVAPLUG" UUID="FE1A-7167" TYPE="vfat"

# fdisk -l

; This is the USB keydrive
Disk /dev/sda: 3999 MB, 3999268864 bytes
124 heads, 62 sectors/track, 1016 cylinders, total 7811072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000bbc04

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      444415      221184   83  Linux
/dev/sda2          444416     7364607     3460096   83  Linux
/dev/sda3         7366654     7809023      221185    5  Extended
/dev/sda5         7366656     7809023      221184   82  Linux swap / Solaris

; This is the empty SD card
Disk /dev/mmcblk0: 16.0 GB, 16012804096 bytes
255 heads, 63 sectors/track, 1946 cylinders, total 31275008 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x40c68308

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1            2048    31275007    15636480    c  W95 FAT32 (LBA)

# lshw -short
H/W path        Device     Class      Description
=================================================
/0/0                       memory     503MiB System memory
/0/2            scsi0      storage
/0/2/0.0.0      /dev/sda   disk       3999MB SCSI Disk
/0/2/0.0.0/1    /dev/sda1  volume     216MiB Linux filesystem partition
/0/2/0.0.0/2    /dev/sda2  volume     3379MiB EXT4 volume
/0/2/0.0.0/3    /dev/sda3  volume     216MiB Extended partition
/0/2/0.0.0/3/5  /dev/sda5  volume     216MiB Linux swap / Solaris partition
 
Old 04-03-2015, 09:05 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,309

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
is the sd-card bigger than the usb drive ?
dd mite work. dd is very destructive if you cross drives. something like:
Code:
dd if=/dev/sdx of=/dev/sdy bs=8192
 
Old 04-03-2015, 10:04 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885Reputation: 4885
Quote:
Originally Posted by littlebigman View Post
1. To avoid wearing out flash memory, I'd like to move /tmp from the flash memory to RAM: Is it a good idea, and if yes, how should I proceed?*
Yes, that is a good idea and basically comes down to adding this line to your /etc/fstab:
Code:
tmpfs                   /tmp                    tmpfs   mode=1777       0 0
By default space in tmp, when using tmpfs, is limited to half your RAM, you can adjust that using the size= mount option.
If you are using Debian Testing/Jessie with systemd you don't need to do that, /tmp is automatically mounted as a tmpfs in that case.
Quote:
2. The system is currently booting and running off a USB keydrive and I'd like to move it an SD card wihtout going through the whole setup again: Can I copy it from the USB keydrive to the SD card? How should I do this?
As schneidz already said, if your SD card is as large as the USB device or larger, just use dd to copy the system over.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Improve system performance by moving your log files to RAM Using Ramlog LXer Syndicated Linux News 0 02-06-2015 05:11 PM
Moving swap and /tmp to ram Serph Debian 2 05-03-2014 11:33 PM
Moving /tmp to ramdisk cyberfishee Linux - Software 2 07-23-2008 07:33 PM
LXer: Improve system performance by moving your log files to RAM LXer Syndicated Linux News 1 07-21-2008 10:30 AM
copying/moving stalls when moving a lot of data to a usb stick =X= Linux - Hardware 10 07-30-2004 05:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:17 PM.

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