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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-03-2015, 08:57 AM
|
#1
|
Member
Registered: Aug 2008
Location: France
Posts: 660
Rep:
|
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
|
|
|
04-03-2015, 09:05 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
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
|
|
|
04-03-2015, 10:04 AM
|
#3
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Quote:
Originally Posted by littlebigman
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.
|
|
|
All times are GMT -5. The time now is 09:57 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|