Dec 02, 2014 The following will create a 2G RAMDISK that will always be available. Sudo mkdir -p /media/ramdisk sudo mount -t tmpfs -o size=2048M tmpfs /media/ramdisk. The ramdisk folder is owned by root as it is to be available on reboot. The ramdisk permissions should be writeable by everyone. Aug 27, 2020 RAM disk is a portion of the RAM that is mounted in your Linux as a directory. Make sure you have enough free RAM on the system so that portion of RAM can be allocated as a RAM disk. Now, Let's create directory /mnt/ramdiskname in your Linux. I imagine that this can work if you do have enough ram for the process's demands. I propose using tmpfs instead of ramfs; this way you 'll prevent kernel hiccups when out of ram. Just create a mount point and then mount a tmpfs on it (like here): # mkdir /mnt/tmpfs.ramdisk # mount -t tmpfs -o size=100M tmpfs /mnt/tmpfs.ramdisk.
Creating the root filesystem involves selecting files necessary for thesystem to run. In this section we describe how to build acompressed root filesystem. A less common option is tobuild an uncompressed filesystem on a diskette that is directly mounted asroot; this alternative is described in Section 9.1.
4.1. OverviewA root filesystem must contain everything needed to support a full Linuxsystem. To be able to do this, the disk must include the minimum requirementsfor a Linux system:
The basic file system structure,
Minimum set of directories: /dev,/proc, /bin, /etc, /lib, /usr, /tmp,
Basic set of utilities: sh, ls, cp,mv, etc.,
Minimum set of config files: rc, inittab, fstab, etc.,
Devices: /dev/hd*, /dev/tty*, /dev/fd0, etc.,
Runtime library to provide basic functions used by utilities.
Of course, any system only becomes useful when you can run somethingon it, and a root diskette usually only becomes useful when youcan do something like:
Check a file system on another drive, for example to check your root filesystem on your hard drive, you need to be able to boot Linux from anotherdrive, as you can with a root diskette system. Then you can runfsck on your original root drive while it is notmounted.
Restore all or part of your original root drive from backup usingarchive and compression utilities such as cpio,tar, gzip andftape.
We describe how to build a compressed filesystem, socalled because it is compressed on disk and, when booted, is uncompressed ontoa ramdisk. With a compressed filesystem you can fit many files (approximatelysix megabytes) onto a standard 1440K diskette. Because the filesystem is muchlarger than a diskette, it cannot be built on the diskette. We have to buildit elsewhere, compress it, then copy it to the diskette.
4.2. Creating the filesystemIn order to build such a root filesystem, you need a spare device thatis large enough to hold all the files before compression. You willneed a device capable of holding about four megabytes. There areseveral choices:
Use a ramdisk (DEVICE =/dev/ram0). In this case, memory is used to simulatea disk drive. The ramdisk must be large enough to hold a filesystem of theappropriate size. If you use LILO, check your configuration file(/etc/lilo.conf) for a line like RAMDISK =nnn which determines the maximum RAM that can be allocated to aramdisk. The default is 4096K, which should be sufficient. You shouldprobably not try to use such a ramdisk on a machine with less than 8MB ofRAM.Check to make sure you have a device like /dev/ram0,/dev/ram or /dev/ramdisk. If not, create/dev/ram0 with mknod (major number1, minor 0).
If you have an unused hard disk partition that is large enough (severalmegabytes), this is acceptable.
Use a loopback device, which allows a disk file to betreated as a device. Using a loopback device you can create a threemegabyte file on your hard disk and build the filesystem on it.
Type man losetup for instructions on using loopbackdevices. If you don't have losetup, you can get italong with compatible versions of mount andunmount from the util-linux packagein the directory ftp://ftp.win.tue.nl/pub/linux/utils/util-linux/.
If you do not have a loop device (/dev/loop0,/dev/loop1, etc.) on your system, you will have tocreate one with ``mknod /dev/loop0 b 7 0'. Once you'veinstalled these special mount andumount binaries, create a temporary file on a hard diskwith enough capacity (eg, /tmp/fsfile). You can use acommand like:to create an nnn-block file.
Use the file name in place of DEVICE below. When you issue amount command you must include the option -o loop to tellmount to use a loopback device.
After you've chosen one of these options, prepare the DEVICEwith:
This command zeroes out the device.
Zeroing the device is critical because the filesystem will be compressedlater, so all unused portions should be filled with zeroes to achieve maximumcompression. Keep this in mind whenever you move or delete files on thefilesystem. The filesystem will correctly de-allocate the blocks,but it will not zero them out again. If you do a lot ofdeletions and copying, your compressed filesystem may end up much larger thannecessary.
Create Ram Disk Linux Download
Next, create the filesystem. The Linux kernel recognizes two file systemtypes for root disks to be automatically copied to ramdisk. These are minixand ext2, of which ext2 is preferred. If using ext2, you may find it usefulto use the -N option to specify more inodes than thedefault; -N 2000 is suggested so that you don't run out ofinodes. Alternatively, you can save on inodes by removing lots of unnecessary/dev files. mke2fs will by defaultcreate 360 inodes on a 1.44Mb diskette. I find that 120 inodes is ample on mycurrent rescue root diskette, but if you include all the devices in/dev you will easily exceed 360. Using a compressed rootfilesystem allows a larger filesystem, and hence more inodes by default, butyou may still need to either reduce the number of files or increase the numberof inodes.
So the command you use will look like:
(If you're using a loopback device, the disk file you're using should besupplied in place of this DEVICE.)
The mke2fs command will automatically detect thespace available and configure itself accordingly. The``-m 0' parameter prevents it from reserving spacefor root, and hence provides more usable space on the disk.
Next, mount the device: (You must create a mount point /mnt if itdoes not already exist.) In the remaining sections, all destinationdirectory names are assumed to be relative to /mnt.
4.3. Populating the filesystemHere is a reasonable minimum set of directories for your root filesystem[1]:
/dev -- Device files, required to perform I/O
/proc -- Directory stub required by theproc filesystem
/etc -- System configuration files
/sbin -- Critical system binaries
/bin -- Essential binaries considered part of thesystem
/lib -- Shared libraries to provide run-timesupport
/mnt -- A mount point for maintenance on otherdisks
/usr -- Additional utilities and applications
Adobe premiere pro 2020 14 0 10. Three of these directories will be empty on the root filesystem, so theyonly need to be created with mkdir. The/proc directory is basically a stub under which theproc filesystem is placed. The directories /mnt and/usr are only mount points for use after the boot/rootsystem is running. Hence again, these directories only need to be created.
The remaining four directories are described in the following sections.
4.3.1. /devA /dev directory containing a special filefor all devices to be used by the system is mandatory for any Linuxsystem. The directory itself is a normal directory, and can becreated with mkdir in the normal way. The devicespecial files, however, must be created in a special way, using themknod command.
There is a shortcut, though — copy devices files from yourexisting hard disk /dev directory. The only requirementis that you copy the device special files using -R option.This will copy the directory without attempting to copy the contents of thefiles. Be sure to use an upper case R.For example:assuming that the diskette is mounted at /mnt. Thedp switches ensure that symbolic links are copied as links,rather than using the target file, and that the original file attributes arepreserved, thus preserving ownership information.
If you want to do it the hard way, use ls -l to display themajor and minor device numbers for the devices you want, and create them onthe diskette using mknod.
However the devices files are created, check that any special devicesyou need have been placed on the rescue diskette. For example,ftape uses tape devices, so you will need to copy all ofthese if you intend to access your floppy tape drive from the bootdisk.
Note that one inode is required for each device special file, and inodescan at times be a scarce resource, especially on diskette filesystems. You'llneed to be selective about the device files you include. For example, if youdo not have SCSI disks you can safely ignore /dev/sd*; ifyou don't intend to use serial ports you can ignore/dev/ttyS*.
If, in building your root filesystem, you get the error Nospace left on device but a df command shows spacestill available, you have probably run out of inodes. A df-i will display inode usage.
Be sure to include the following files from this directory:console, kmem, mem, null,ram0 and tty1. Live home 3d pro 3 6 4.
4.3.2. /etcThe /etc directory contains configuration files. What it should containdepends on what programs you intend to run.On most systems, these can be divided into three groups:
Required at all times, e.g.rc,fstab, passwd.
May be required, but no one is too sure.
Junk that crept in.
Files which are not essential can usually be identified with the command:On my root diskettes, I have the number of config files down to15. This reduces my work to dealing with three sets of files:
The ones I must configure for a boot/root system:
rc.d/* -- system startup and run level change scripts
fstab -- list of file systems to be mounted
inittab -- parameters for theinit process, the first process started at boot time.
gettydefs -- parameters for theinit process, the first process started at boot time.
The ones I should tidy up for a boot/root system:
passwd -- Critical list of users, home directories, etc.
group -- user groups.
Weathersnoop 4 1 99. shadow -- passwords of users. You may not have this.
termcap -- the terminal capability database.
If security is important, passwd andshadow should be pruned to avoid copying user passwordsoff the system, and so that unwanted logins are rejected when you boot fromdiskette.
Be sure that passwd contains at leastroot. If you intend other users to login, be sure theirhome directories and shells exist.
termcap, the terminal database, is typically severalhundred kilobytes. The version on your boot/root diskette should be pruneddown to contain only the terminal(s) you use, which is usually just thelinux or linux-console entry.
The rest. They work at the moment, so I leave them alone.
Out of this, I only really have to configure two files, and what theyshould contain is surprisingly small.
rc should contain:Be sure it is executable, be sure it has a '#!' line at the top, and be sureany absolute filenames are correct. You don't really need to runhostname — it just looks nicer if you do.
fstab should contain at least:You can copy entries from your existing fstab, but youshould not automatically mount any of your hard disk partitions; use thenoauto keyword with them. Your hard disk may be damagedor dead when the bootdisk is used.
Your inittab should be changed so that itssysinit line runs rc or whateverbasic boot script will be used. Also, if you want to ensure that users onserial ports cannot login, comment out all the entries forgetty which include a ttys orttyS device at the end of the line. Leave in thetty ports so that you can login at the console.
A minimal inittab file looks like this: The inittab file defines what the system will run invarious states including startup, move to multi-user mode, etc. Check carefully the filenames mentioned in inittab; ifinit cannot find the program mentioned the bootdisk willhang, and you may not even get an error message.
Note that some programs cannot be moved elsewhere because other programs havehardcoded their locations. For example, on my system,/etc/shutdown has hardcoded in it/etc/reboot. If I move reboot to/bin/reboot, and then issue a shutdowncommand, it will fail because it cannot find the rebootfile.
For the rest, just copy all the text files in your/etc directory, plus all the executables in your/etc directory that you cannot be sure you do not need.As a guide, consult the sample listing in Appendix C. Probablyit will suffice to copy only those files, but systems differ a great deal, soyou cannot be sure that the same set of files on your system is equivalent tothe files in the list. The only sure method is to start withinittab and work out what is required.
Most systems now use an /etc/rc.d/ directorycontaining shell scripts for different run levels. The minimum is a singlerc script, but it may be simpler just to copyinittab and the /etc/rc.ddirectory from your existing system, and prune the shell scripts in therc.d directory to remove processing not relevent to adiskette system environment.
4.3.3. /bin and /sbinThe /bin directory is a convenient place for extrautilities you need to perform basic operations, utilities such asls, mv, cat anddd. See Appendix C for an example listof files that go in a /bin and/sbin directories. It does not include any of theutilities required to restore from backup, such as cpio,tar and gzip. That is because Iplace these on a separate utility diskette, to save space on the boot/rootdiskette. Once the boot/root diskette is booted, it is copied to theramdisk leaving the diskette drive free to mount another diskette, theutility diskette. I usually mount this as /usr.
Creation of a utility diskette is described below in Section 9.2. It is probably desirable to maintain a copy of thesame version of backup utilities used to write the backups so you don'twaste time trying to install versions that cannot read your backup tapes.
Be sure to include the following programs: init,getty or equivalent, login, mount, someshell capable of running your rc scripts, a link from sh to theshell.
4.3.4. /libIn /lib you place necessary shared libraries andloaders. If the necessary libraries are not found in your/lib directory then the system will be unable to boot.If you're lucky you may see an error message telling you why.
Nearly every program requires at least the libclibrary, libc.so.N, whereN is the current version number. Check your/lib directory. The filelibc.so.N is usually a symlink to a filename with acomplete version number:
In this case, you want libc-2.1.1.so. To findother libraries you should go through all the binaries you plan to includeand check their dependencies with ldd. For example:Each file on the right-hand side is required. The file may be a symboliclink.
Note that some libraries are quite large andwill not fit easily on your root filesystem. For example, thelibc.so listed above is about 4 meg. You willprobably need to strip libraries when copying them to your root filesystem.See Section 8 for instructions.
In /lib you must also include a loader for the libraries.The loader will be either ld.so (for A.OUT libraries,which are no longer common) or ld-linux.so (forELF libraries). Newer versions of ldd tell you exactlywhich loader is needed, as in the example above, but older versions may not.If you're unsure which you need, run the file command onthe library. For example:The QMAGIC indicates that 4.7.2 is forA.OUT libraries, and ELF indicates that5.4.33 and 2.1.1 are for ELF.
Copy the specific loader(s) you need to the root filesystem you're building.Libraries and loaders should be checked carefully againstthe included binaries. If the kernel cannot load a necessary library, thekernel may hang with no error message.
4.4. Providing for PAM and NSSYour system may require dynamically loaded libraries that are not visible toldd. If you don't provide for these, you may havetrouble logging in or using your bootdisk.
4.4.1. PAM (Pluggable Authentication Modules)If your system uses PAM (Pluggable Authentication Modules), you must make someprovision for it on your bootdisk. Briefly, PAM is a sophisticated modularmethod for authenticating users and controlling their access to services. Aneasy way to determine if your system uses PAM is run lddon your login executable; if the output includeslibpam.so, you need PAM.
Fortunately, security is usually of no concern with bootdisks sinceanyone who has physical access to a machine can usually do anything theywant anyway. Therefore, you can effectively disable PAM by creating asimple /etc/pam.conf file in your root filesystem thatlooks like this:Also copy the file /lib/security/pam_permit.so toyour root filesystem. This library is only about 8K so it imposes minimaloverhead.
This configuration allows anyone complete access to the files andservices on your machine. If you care about security on your bootdisk forsome reason, you'll have to copy some or all of your hard disk's PAM setup toyour root filesystem. Be sure to read the PAM documentation carefully, andcopy any libraries needed in /lib/security onto your rootfilesystem.
You must also include /lib/libpam.so on your bootdisk.But you already know this since you ran ldd on/bin/login, which showed this dependency.
4.4.2. NSS (Name Service Switch)If you are using glibc (aka libc6), you will have to make provisionsfor name services or you will not be able to login. The file/etc/nsswitch.conf controls database lookups forvarious servies. If you don't plan to access services from thenetwork (eg, DNS or NIS lookups), you need only prepare a simplensswitch.conf file that looks like this:This specifies that every service be provided only by local files.You will also need to include/lib/libnss_files.so.X,where X is 1 for glibc 2.0 and 2 for glibc 2.1.This library will be loaded dynamically to handle the file lookups.
If you plan to access the network from your bootdisk, you may want to create amore elaborate nsswitch.conf file. See thensswitch man page for details. You must include a file/lib/libnss_service.so.1for each service you specify.
4.5. ModulesIf you have a modular kernel, you must consider which modules youmay want to load from your bootdisk after booting. You might want toinclude ftape and zftape modules ifyour backup tapes are on floppy tape, modules for SCSI devices if you havethem, and possibly modules for PPP or SLIP support if you want to accessthe net in an emergency.
These modules may be placed in /lib/modules. You should alsoinclude insmod, rmmod and lsmod. Depending on whether youwant to load modules automatically, you might also include modprobe,depmod and swapout. If you usekerneld, include it alongwith /etc/conf.modules.
However, the main advantage to using modules is that you can move non-criticalmodules to a utility disk and load them when needed, thus using less space onyour root disk. If you may have to deal with many different devices, thisapproach is preferable to building one huge kernel with many drivers built in.
In order to boot a compressed ext2 filesystem, you must have ramdisk andext2 support built-in. They cannot be supplied asmodules.
4.6. Some final detailsSome system programs, such as login, complain ifthe file /var/run/utmp and the directory/var/log do not exist. So:
Finally, after you have set up all the libraries you need, runldconfig to remake /etc/ld.so.cache onthe root filesystem. The cache tells the loader where to find the libraries.You can do this with:
4.7. Wrapping it upOn my root diskettes, I have the number of config files down to15. This reduces my work to dealing with three sets of files:
The ones I must configure for a boot/root system:
rc.d/* -- system startup and run level change scripts
fstab -- list of file systems to be mounted
inittab -- parameters for theinit process, the first process started at boot time.
gettydefs -- parameters for theinit process, the first process started at boot time.
The ones I should tidy up for a boot/root system:
passwd -- Critical list of users, home directories, etc.
group -- user groups.
Weathersnoop 4 1 99. shadow -- passwords of users. You may not have this.
termcap -- the terminal capability database.
If security is important, passwd andshadow should be pruned to avoid copying user passwordsoff the system, and so that unwanted logins are rejected when you boot fromdiskette.
Be sure that passwd contains at leastroot. If you intend other users to login, be sure theirhome directories and shells exist.
termcap, the terminal database, is typically severalhundred kilobytes. The version on your boot/root diskette should be pruneddown to contain only the terminal(s) you use, which is usually just thelinux or linux-console entry.
The rest. They work at the moment, so I leave them alone.
Out of this, I only really have to configure two files, and what theyshould contain is surprisingly small.
rc should contain:Be sure it is executable, be sure it has a '#!' line at the top, and be sureany absolute filenames are correct. You don't really need to runhostname — it just looks nicer if you do.
fstab should contain at least:You can copy entries from your existing fstab, but youshould not automatically mount any of your hard disk partitions; use thenoauto keyword with them. Your hard disk may be damagedor dead when the bootdisk is used.
Your inittab should be changed so that itssysinit line runs rc or whateverbasic boot script will be used. Also, if you want to ensure that users onserial ports cannot login, comment out all the entries forgetty which include a ttys orttyS device at the end of the line. Leave in thetty ports so that you can login at the console.
A minimal inittab file looks like this: The inittab file defines what the system will run invarious states including startup, move to multi-user mode, etc. Check carefully the filenames mentioned in inittab; ifinit cannot find the program mentioned the bootdisk willhang, and you may not even get an error message.
Note that some programs cannot be moved elsewhere because other programs havehardcoded their locations. For example, on my system,/etc/shutdown has hardcoded in it/etc/reboot. If I move reboot to/bin/reboot, and then issue a shutdowncommand, it will fail because it cannot find the rebootfile.
For the rest, just copy all the text files in your/etc directory, plus all the executables in your/etc directory that you cannot be sure you do not need.As a guide, consult the sample listing in Appendix C. Probablyit will suffice to copy only those files, but systems differ a great deal, soyou cannot be sure that the same set of files on your system is equivalent tothe files in the list. The only sure method is to start withinittab and work out what is required.
Most systems now use an /etc/rc.d/ directorycontaining shell scripts for different run levels. The minimum is a singlerc script, but it may be simpler just to copyinittab and the /etc/rc.ddirectory from your existing system, and prune the shell scripts in therc.d directory to remove processing not relevent to adiskette system environment.
4.3.3. /bin and /sbinThe /bin directory is a convenient place for extrautilities you need to perform basic operations, utilities such asls, mv, cat anddd. See Appendix C for an example listof files that go in a /bin and/sbin directories. It does not include any of theutilities required to restore from backup, such as cpio,tar and gzip. That is because Iplace these on a separate utility diskette, to save space on the boot/rootdiskette. Once the boot/root diskette is booted, it is copied to theramdisk leaving the diskette drive free to mount another diskette, theutility diskette. I usually mount this as /usr.
Creation of a utility diskette is described below in Section 9.2. It is probably desirable to maintain a copy of thesame version of backup utilities used to write the backups so you don'twaste time trying to install versions that cannot read your backup tapes.
Be sure to include the following programs: init,getty or equivalent, login, mount, someshell capable of running your rc scripts, a link from sh to theshell.
4.3.4. /libIn /lib you place necessary shared libraries andloaders. If the necessary libraries are not found in your/lib directory then the system will be unable to boot.If you're lucky you may see an error message telling you why.
Nearly every program requires at least the libclibrary, libc.so.N, whereN is the current version number. Check your/lib directory. The filelibc.so.N is usually a symlink to a filename with acomplete version number:
In this case, you want libc-2.1.1.so. To findother libraries you should go through all the binaries you plan to includeand check their dependencies with ldd. For example:Each file on the right-hand side is required. The file may be a symboliclink.
Note that some libraries are quite large andwill not fit easily on your root filesystem. For example, thelibc.so listed above is about 4 meg. You willprobably need to strip libraries when copying them to your root filesystem.See Section 8 for instructions.
In /lib you must also include a loader for the libraries.The loader will be either ld.so (for A.OUT libraries,which are no longer common) or ld-linux.so (forELF libraries). Newer versions of ldd tell you exactlywhich loader is needed, as in the example above, but older versions may not.If you're unsure which you need, run the file command onthe library. For example:The QMAGIC indicates that 4.7.2 is forA.OUT libraries, and ELF indicates that5.4.33 and 2.1.1 are for ELF.
Copy the specific loader(s) you need to the root filesystem you're building.Libraries and loaders should be checked carefully againstthe included binaries. If the kernel cannot load a necessary library, thekernel may hang with no error message.
4.4. Providing for PAM and NSSYour system may require dynamically loaded libraries that are not visible toldd. If you don't provide for these, you may havetrouble logging in or using your bootdisk.
4.4.1. PAM (Pluggable Authentication Modules)If your system uses PAM (Pluggable Authentication Modules), you must make someprovision for it on your bootdisk. Briefly, PAM is a sophisticated modularmethod for authenticating users and controlling their access to services. Aneasy way to determine if your system uses PAM is run lddon your login executable; if the output includeslibpam.so, you need PAM.
Fortunately, security is usually of no concern with bootdisks sinceanyone who has physical access to a machine can usually do anything theywant anyway. Therefore, you can effectively disable PAM by creating asimple /etc/pam.conf file in your root filesystem thatlooks like this:Also copy the file /lib/security/pam_permit.so toyour root filesystem. This library is only about 8K so it imposes minimaloverhead.
This configuration allows anyone complete access to the files andservices on your machine. If you care about security on your bootdisk forsome reason, you'll have to copy some or all of your hard disk's PAM setup toyour root filesystem. Be sure to read the PAM documentation carefully, andcopy any libraries needed in /lib/security onto your rootfilesystem.
You must also include /lib/libpam.so on your bootdisk.But you already know this since you ran ldd on/bin/login, which showed this dependency.
4.4.2. NSS (Name Service Switch)If you are using glibc (aka libc6), you will have to make provisionsfor name services or you will not be able to login. The file/etc/nsswitch.conf controls database lookups forvarious servies. If you don't plan to access services from thenetwork (eg, DNS or NIS lookups), you need only prepare a simplensswitch.conf file that looks like this:This specifies that every service be provided only by local files.You will also need to include/lib/libnss_files.so.X,where X is 1 for glibc 2.0 and 2 for glibc 2.1.This library will be loaded dynamically to handle the file lookups.
If you plan to access the network from your bootdisk, you may want to create amore elaborate nsswitch.conf file. See thensswitch man page for details. You must include a file/lib/libnss_service.so.1for each service you specify.
4.5. ModulesIf you have a modular kernel, you must consider which modules youmay want to load from your bootdisk after booting. You might want toinclude ftape and zftape modules ifyour backup tapes are on floppy tape, modules for SCSI devices if you havethem, and possibly modules for PPP or SLIP support if you want to accessthe net in an emergency.
These modules may be placed in /lib/modules. You should alsoinclude insmod, rmmod and lsmod. Depending on whether youwant to load modules automatically, you might also include modprobe,depmod and swapout. If you usekerneld, include it alongwith /etc/conf.modules.
However, the main advantage to using modules is that you can move non-criticalmodules to a utility disk and load them when needed, thus using less space onyour root disk. If you may have to deal with many different devices, thisapproach is preferable to building one huge kernel with many drivers built in.
In order to boot a compressed ext2 filesystem, you must have ramdisk andext2 support built-in. They cannot be supplied asmodules.
4.6. Some final detailsSome system programs, such as login, complain ifthe file /var/run/utmp and the directory/var/log do not exist. So:
Finally, after you have set up all the libraries you need, runldconfig to remake /etc/ld.so.cache onthe root filesystem. The cache tells the loader where to find the libraries.You can do this with:
4.7. Wrapping it upWhen you have finished constructing the root filesystem, unmount it, copy itto a file and compress it:When this finishes you will have a file rootfs.gz. Thisis your compressed root filesystem. You should check its size to make sure itwill fit on a diskette; if it doesn't you'll have to go back and remove somefiles. Some suggestions for reducing root filesystem size appear in Section 8.
Notes[1]The directory structure presented here is for root diskette use only.Real Linux systems have a more complex and disciplined set of policies, calledthe FilesystemHierarchy Standard, for determining where files should go.)
Glomation GESBC-93XX series single board computers use RAM disk as the root file system in it's default configuration. Most likely one would want to create/change the RAM disk to have user applications installed. This guide describes how to mount and edit files in a RAM disk image, unmount the image and recompress it.
System Requirement
In order to mount a RAM disk image, your development system must have MTD support compiled in, and have the Loopback Interface available. Most Linux distribution have these configured in the kernel.
To check the availability of MTD and loopback interface, issue the following command on the development system.
If any information is shown with /proc/mtd, and if you see any files named mtdblock, mtd, etc that means the system has MTD support.
If not please rebuild the Linux kernel with MTD support. The follow instruction shows the basic steps to do that.
Go to the kernel source tree directory on your development system and issue..
The following options must be enabled to use MTD.
As well as..
After the kernel has been reconfigured, re-build the kernel, install the new kernel and reboot your development system.
Once you have MTD and RAM disk support on your development system, you are ready to create/modify the RAM disk image.
Create New RAM Disk Image
The Ext2 file system can be created and mounted onto an embedded device using the concept of RAM disk.
mke2fs is the utility used to create an ext2 file system -- creating the super block, inodes, inode table, and etc -- on any device.
In the above usage, /dev/ram is the device on which an ext2 file system of 16384 blocks is built. Then the device (/dev/ram) is mounted on a temporary directory named /mnt and all the necessary files are copied. Once these files are copied, the file system is unmounted and the contents of the device (/dev/ram) is dumped into a file (ramdisk), which is the required RAM disk (the Ext2 file system). The RAM disk file is then compressed and ready to be loaded by Redboot.
The above sequence creates a RAM disk of 16 MB and fills it with the necessary file utilities.
Some of the important directories to include in RAM disk are:
/bin -- Holds most of the binaries like init, busybox, shell, file management utilities, and
etc.
/dev -- Contains all the device nodes used in the device
Create Ram Disk Linux Windows 10
/etc -- Contains all the configuration files for the system
/lib -- Contains all the necessary libraries like libc, libdl, and so on
Modify Existing RAM Disk Image
- First uncompress the ramdisk.gz file.
- Make a directory to mount the ramdisk image.
- Mount the ramdisk image as a loop back device .
You can then issue the command 'df' to see the new RAM disk partition on you development system.
- Edit Files
You can now edit files inside the RAM disk. Depending on how the original RAM disk is created, you may or may not have enough space on the RAM disk to install your application. Refer to Create New RAM Disk Image section on how to create a new RAM disk with more storage space.
- Unmount the ramdisk and compress it.
You will then have a new compressed root file system that you can now load with RedBoot.