slitaz-doc-wiki-data view pages/en/guides/sdcard.txt @ rev 7

Add pages/en folder.
author Christopher Rogers <slaxemulator@gmail.com>
date Sat Feb 26 12:17:18 2011 +0000 (2011-02-26)
parents
children
line source
1 ====== Installing SliTaz to a MMC/SD-card ======
2 SliTaz can be installed to a MMC/SD flash-memory card (the kind used in digital cameras) in either of two ways: in a LiveUSB version as used on a "memory-stick" (also called "thumb-drive", "flash-drive", or a variety of other names), or as a regular install as used on a hard-drive. There are advantages and disadvantages to both methods.
4 ===== LiveUSB-type installation =====
5 A memory-stick uses NAND flash memory which eventually wears out after about 100,000 read/write cycles. SliTaz tries to minimize this wear, and thus prolong the life of the memory-stick, by storing the entire main root-file-system ("rootfs") as a compressed image in one file (rootfs.gz), then uncompressing it into the machine's memory (RAM) when booting. Only the /home directory is normally written onto the memory-stick, unless the user issues this command:
6 <code>
7 # tazusb writefs [compression]
8 </code>
9 Where "[compression]" can be "lzma", "gzip", or "none". This command re-writes the rootfs.gz file onto the memory-stick, so that changes made to the system can be saved and used again at the next boot-up. The big advantage to using this method is obviously that it prolongs the life of the USB device. The big disadvantage is that booting takes a long time because of the use of compression, and the more packages you install to your rootfs system the longer it takes to boot. The rootfs can also be saved without compression (i.e., # tazusb writefs none), which will allow it to boot much faster. This was not such a good option when SliTaz 1.0 was released in 2008, because memory-sticks had much less storage space then, but with 4 GB memory-sticks common now, it's not as much of a problem. This same method can be used to install SliTaz to a MMC/SD card.
11 ===== Regular "hard-drive"-type installation =====
12 The other option is to treat the MMC/SD card as if it were a real hard-drive, and simply use:
13 <code>
14 # gparted
15 </code>
16 to format the card and set up partitions like on a regular hard-drive, and
17 <code>
18 # slitaz-installer
19 </code>
20 to do the actual installation. Be sure to also allow the installer to install GRUB onto the card, so that you can boot from it the normal way, same as you would from a regular hard-drive.
22 ===== Example as used on my own Asus Eee-PC =====
23 The SliTaz installation which I put onto a MMC/SD-card (16 GB) was for my Asus Eee-PC 701, leaving the Eee's original Xandrox Linux installation intact on its SSD (solid-state drive), and keeping the MMC/SD-card with SliTaz always in the card-reader slot. The Eee's BIOS needed to be changed to allow the SD-card to be the first boot device, so that the machine would boot into GRUB before anything else. The /boot/grub/menu.lst is setup to allow me to boot from either Xandros or SliTaz on the GRUB menu:
24 <file>
25 # /boot/grub/menu.lst: GRUB boot loader configuration.
26 #
28 # By default, boot the first entry.
29 default 0
31 # Boot automatically after 8 secs.
32 timeout 8
34 # Change the colors.
35 color yellow/brown light-green/black
37 # To boot newest slitaz from : /dev/sdb5
38 #
39 title SliTaz GNU/Linux (cooking - kernel 2.6.30.6)
40 root (hd0,4)
41 # kernel /boot/vmlinuz-2.6.30.6-slitaz rootdelay=10 root=/dev/sdb5
42 # the kernel line used to be necessary
43 # but apparently a later upgrade of SliTaz commented it out
44 # GRUB boots into SliTaz with no problem using only the root (hd0,4) command
46 # To boot Asus eee pc Xandros
47 #
48 title Xandros (kernel vmlinuz-2.6.21.4-eeepc)
49 root (hd1,0)
50 kernel /boot/vmlinuz-2.6.21.4-eeepc quiet rw vga=785 irqpoll i8042.noloop=1 root=/dev/sda1
51 initrd /boot/initramfs-eeepc.img
52 </file>
54 The first 3 partitions on my MMC/SD-card were originally used as storage for various parts of the Eee's Xandros system, with the 4th partition formatted as an Extended Partition and further divided into two, with Partition 5 used for the SliTaz install and Partition 6 for Linux-Swap. But because this SliTaz installation has become my main one for the Eee, as I added more packages I finally decided to move parts of the SliTaz filesystem to other partitions and use this layout:
55 <code>
56 $ df -h
57 Filesystem Size Used Available Use% Mounted on
58 rootfs 1.4G 413.3M 913.1M 31% /
59 /dev/root 1.4G 413.3M 913.1M 31% /
60 tmpfs 500.7M 0 500.7M 0% /dev/shm
61 /dev/sdb2 3.0G 1.4G 1.6G 46% /usr
62 /dev/sdb3 2.5G 2.1G 323.0M 87% /home
63 /dev/sdb1 7.4G 5.2G 1.9G 73% /home/shared
64 </code>
66 The /home/shared directory is one which has documents shared by the Xandros system.
68 The Eee-PC was already set-up to recognize and read the MMC/SD-card. But one day I accidentally moved the whole contents of /boot to another directory and thus was unable to boot SliTaz. When I inserted the card into a Toshiba Satellite A215-S5850 laptop (my biggest, most modern, and main laptop), I was surprised to find that the machine did not see the MMC/SD-card. It was necessary to add a kernel package:
69 <code>
70 # tazpkg get-install linux-mmc
71 </code>
72 and then to load this module:
73 <code>
74 # modprobe mmc_block
75 </code>
76 After that, SliTaz was able to read the contents of the MMC/SD-card, and I was able to move the /boot files back to where they belonged and fix the system. If the output of
77 <code>
78 # lsmod
79 </code>
80 does not show mmc_block, then that module must be loaded manually. To have SliTaz always load it at boot-up, simply add it to the LOAD_MODULES line of /etc/rcS.conf.
82 ----
83 \\
84 ^ Page Review Section ^^
85 |Quality| Good |
86 |Review| Minor Updates |
87 |Priority| Medium |
88 |Problems| add a [[http://forum.slitaz.org|forum post link]]|
89 |::: | OR add a [[http://labs.slitaz.org/issues |lab issue tracker link ]]|
90 |How to Improve| Suggest briefly|
91 |::: | |
93 \\
94 ----