Right way to permanently mount SD card on appliance?
Linux - SoftwareThis 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.
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.
Right way to permanently mount SD card on appliance?
Hello
Since NAND memory wears out each time a file is written, I added an SD card to an appliance running Debian 6.
I can mount the card just fine manually with "mount /dev/mmcblk0 /mnt/sdcard", but I'd like to make sure editing /etc/fstab is the right way to have Linux mount it automatically at boot time.
Here's the infos:
Code:
# fdisk -l
Disk /dev/mmcblk0: 3957 MB, 3957325824 bytes
61 heads, 60 sectors/track, 2111 cylinders
Units = cylinders of 3660 * 512 = 1873920 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 3 2112 3860480 b W95 FAT32
# mount
ubi0:rootfs on / type ubifs (rw,noatime)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
tmpfs on /var/run type tmpfs (rw,nosuid,size=1M,mode=0755)
tmpfs on /var/lock type tmpfs (rw,noexec,nosuid,nodev,size=1M,mode=1777)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
/dev/mmcblk0p1 on /mnt/sdcard type vfat (rw)
# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
ubi0:rootfs / ubifs defaults,noatime,rw 0 0
tmpfs /var/run tmpfs size=1M,rw,nosuid,mode=0755 0 0
tmpfs /var/lock tmpfs size=1M,rw,noexec,nosuid,nodev,mode=1777 0 0
tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0
I use noatime in mount options with flash, as it's supposed to avoid an extra write by not updating access times of files. Of course, replace 2/3/4 with the version of extfs you used to format the disk. If not using extfs, replace with the appropriate file system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.