IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

HOWTOs

Search Howtos :Match :

6. Some basic concepts

In this section we discuss in a very brief manner, some basic Linux concepts which should contribute to an understanding of the procedures described below.

6.1. The /proc filesystem

The /proc filesystem serves as a window through which we can see the workings of a Linux setup. The objects of most interest for this document are the directories/proc/bus/usb/ and /proc/scsi/. These will be used to verify that the kernel had been set up properly for our purpose (Section 7.2).

6.2. SCSI devices

Your memory stick will be considered as a USB mass storage device posing as a removable SCSI disk (sd). SCSI disk devices are mapped to the /dev (devices) directory under /dev/sda , /dev/sdb , ... When different disk devices are present, they will be mapped to /dev/sda, /dev/sdb, etc. If, for example, a memory stick and a digital camera are plugged in, the one would be mapped to /dev/sda and the other to /dev/sdb. Tests have indicated that the first device to be detected is mapped to sda and represented in the directory /proc/scsi/usb-storage-0. The second will be mapped to sdb and represented in /proc/scsi/usb-storage-0. What will happen when both devices are present at boot-up, is not known. An overview of the partitions relevant to this document, the file /proc/partitions may be consulted. Look for entries like sda, sda1, sdb. Under the Linux-2.6 series of kernels this problem may be very neatly resolved (Section 12).

In the descriptions further on, it will be assumed that only one memory stick is present, and therefore mapped to /dev/sda.

In most distributions these points exist in abundance. You should check that this is the case in your setup (ls /dev/sda*. If there are none you can create them by doing (as root, indicated by the hash).


             # mknod /dev/sda  b 8 0
             # mknod /dev/sda1 b 8 1
             # mknod /dev/sda2 b 8 2
   

etc, up to /dev/sda15 if necessary. The device as a whole is mapped to /dev/sda, while /dev/sdax (x = 1 ... 15) represent the various partitions of the device. We shall describe, later on, how to create different partitions for different file systems (see Section 8 and Section 9 ). If you intend to use your memory stick with a single partition (filesystem), /dev/sda1 is sufficient.

6.3. The USB device filesystem

This dynamically generated filesystem should be mounted at /proc/bus/usb/. It is therefore essential that this mount point exists. Once it is mounted, there should be more to be seen in /proc/bus/usb/ and in /proc/scsi/ (Section 7.3). To find out which USB devices are present, read the file /proc/bus/usb/devices ( less /proc/bus/usb/devices). It takes a small effort to interpret the writing on the screen, but it is not difficult. A memory stick is indicated by Mass Storage Device.

6.4. The ext2 filesystem

The ext2 (second extended) filesystem still is the most prevalent in Linux setups. It is most versatile and sophisticated, carrying with it permissions (read-write-execute, who is permitted to do what), ownership (user, group, others), a timestamp (when last modified), etc. Moreover, tools for the proper maintenance of a device endowed with ext2, exist (Section 11). If a flash memory device is to be used exclusively within Linux setups, it is therefore desirable to format it in ext2 (see Section 8).

6.5. The vfat filesystem

Enabling vfat in the kernel makes it possible to mount filesystems created under Dos/Windows to be mounted in a Linux system. Most memory sticks are formatted for direct use on Windows and should therefore be considered as vfat-formatted. The vfat filesystem is less sophisticated than ext2 and will therefore be more economic as far as memory space is concerned. It does not carry permissions in the same way as ext2 with the result that an ext2-file saved in vfat will re-appear with its permissions changed. Nonetheless, if a memory stick is to be used for the purpose of carrying data between Linux and Windows machines, it is best to keep it in the vfat format. A compromise is to partition the memory stick in two parts: one in vfat and the other in ext2. At least the Linux machine should be able to handle both. This is described in Section 9

6.6. Explanation of command options

Here is a short list of command options that occur in this document:

  • mount -t ext2 /dev/sda1 /mnt/memstick Mount in filetype ext2, device sda1 at mountpoint /mnt/memstick
  • ls -l Make a complete list (modes, ownerships, etc.)
  • mkdosfs -F 32 /dev/sda1 Create an ms-dos filesystem, FAT-size 32, on the partition /dev/sda1
  • ln -s /dev/sda1 /dev/flash link, symbolically, the existing /dev/sda1 to the symbolic /dev/flash
  • mkdir -m 777 /mnt/memstick/superdir create a new directory with mode rwx for user, group and others
  • dumpe2fs -h /dev/sda1 Show the header of the ext2 partition /dev/sda1
Search Howtos :Match :
Xine 1.1.6
Free video player
Glade 3.5.5
User interface builder for GTK+ and Gnome
Evolution 2.25.4
GNOME mailer, calendar, contact manager and communications tool
GEdit 2.25.4
Small but powerful text editor
Mutt 1.5.19
Small but very powerful text-based mail client.
Galculator 1.3.2
GTK 2 based scientific calculator
BlueFish 1.3.1
GTK HTML editor
Samba 3.3.0rc2
Provides file and print services to SMB/CIFS clients
WebGUI 7.5.38
A fully featured content management system.
Brasero 0.9.0
Application to burn CD/DVD
Free IT Magazines, White Papers, eBooks, and more !
Dr. Dobb's Journal

Dr. Dobb's Journal enables programmers to write the most efficient and sophisticated programs and help in daily programming quandaries.

The 7 Things that IT Security Professionals MUST KNOW!

Gain key insight into security problem and find the safest means to protect your technological assets.

Database Trends and Applications

Provides timely coverage of the technology, intelligence and insight needed to plan, implement and manage information-rich projects.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info