LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-13-2013, 06:15 AM   #1
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Rep: Reputation: 35
Question 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
Thank you.
 
Old 05-13-2013, 06:28 AM   #2
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
I'm guessing you formatted it with ext2/3/4?

Code:
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mmcblk0p1    /mnt/sdcard    ext2/3/4  defaults,noatime  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.
 
Old 05-13-2013, 05:33 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
if the port it is plugged into is never going to change then fstab is just fine

but if the card is removed then you will not be able to boot

a udev rule would solve this
but might be more work than is needed if the card will never be removed

Last edited by John VV; 05-13-2013 at 05:34 PM.
 
  


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
[SOLVED] How can i permanently mount a folder in centos jsaravana87 Linux - Server 4 09-16-2011 12:38 AM
how to mount all the other drives during boot permanently.... kmr.ndrsh Sabayon 3 04-24-2011 03:40 AM
How do I permanently mount local device? hmsdefender Linux - Newbie 8 11-06-2009 12:44 PM
Mount floppy permanently ajdougal2003 Linux - Newbie 8 10-12-2003 10:00 AM
Mount Windows permanently netjack Red Hat 5 09-27-2003 09:22 AM

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

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