Ext2tools—Reading Linux files from DOS
I don't know about you, but I will admit to using Windows on my PC along with Linux. It's just that some Windows applications are still better than those available for the X windows system. (No flames, please. I didn't mention any names!)
Unfortunately, using both Windows and Linux on the same machine means I sometimes have important files on the MS-DOS partition, which I need while using Linux. I can access files on the MS-DOS partition with Linux, but often the opposite is true—I need to access Linux files from DOS or Windows 95. This used to involve getting out of Windows, booting Linux, moving a file to the DOS partition, and then rebooting Windows. Not a particularly convenient method!
NB: Be sure to have Loadlin working or a working Linux boot disk before you try loading Windows 95 if you use LILO to start Linux, as the installation of Windows will overwrite the Master Boot Record.
But it isn't that complicated any more, thanks to ext2tools, a collection of DOS programs written by Claus Tondering (firstname.lastname@example.org ). ext2tools allows me to read Linux (ext2) files directly from DOS or Windows. Five of ext2tools' DOS programs mimic Unix commands, and a sixth is used for set-up. The programs are E2CAT, E2CD, E2CP, E2LS, E2PART and E2PWD.
Using these commands is straightforward. From DOS, or a DOS window, you get a listing of the files in your Linux root directory with the command e2ls. If you want a listing of another directory, just add the directory name.
To change to another Linux directory, say, home, you enter e2cd home. Another e2ls then lists the files in home. If you find the file you need in the home directory, say it is called stuff.ext, typing e2cp stuff.ext stuff.dos will copy the file into stuff.dos in your present DOS directory. To just look at the file instead, e2cat stuff.ext will list it on your DOS screen.
The other DOS programs included in ext2tools are E2PWD, which gives the Linux directory you are currently in, and E2PRT, which is used to determine the partitions on a hard disk, which is to be signified by the disk number discussed below.
The set-up of ext2tools is really simple. It just requires you to add one line to your DOS autoexec.bat file to define the environmental variable e2cwd. The value of this variable is set to a two (or three) part number. I use:
The 128 indicates the first hard disk (129 would be the second.). The 2 denotes the partition number of the ext2 file system on that disk. A third number, which I omit, is the inode number of the current working directory. Leaving it blank results in the default value of 2, which identifies the root directory. After re-running autoexec.bat in a DOS window, typing that command on the command line, or simply rebooting DOS/Windows, you should be ready to use the tool program.
Claus Tondering, the author of the program and a Unix programmer/electrical engineer at Olicom in Denmark, says there are two limitations of ext2tools that he knows of. If there are three or more partitions inside an extended partition table, the table is read incorrectly. Secondly, if you have more than two hard disks, there is no way to get to the third, due to limitations on the use of BIOS for disk information. He hopes that the next version should take care of both these problems and may even support wild cards, but no promises.
The access to the Linux file system by ext2tools is read-only. To write Linux files you must be in Linux. In fact, Tondering does not plan to add write capabilities to these DOS programs as he fears that it could be dangerous for a variety of reasons.
Finally, a big warning. ext2tools gives superuser status to the DOS user, as it does not respect the access permissions of the Linux file system. This was by design, since having DOS on a Linux system is an inherent security risk anyway. Be careful if you install it on a multi-user system.
See Getting ext2tools sidebar for more information.
Robert A. Dalrymple (email@example.com) works at the University of Delaware and tends two machines that are half-and- half (Win95/Linux). He thanks Claus Tondering for helpful comments.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- Paranoid Penguin - Building a Secure Squid Web Proxy, Part IV
- SUSE LLC's SUSE Manager
- Google's SwiftShader Released
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- My +1 Sword of Productivity
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- SuperTuxKart 0.9.2 Released
- Parsing an RSS News Feed with a Bash Script
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide