Archive for November, 2007

You never, never, never, never, never (Fedora web server) want to

Friday, November 9th, 2007

You never, never, never, never, never want to run the command I mabout to use on a partition you re using or you will mess it up badly! 7.Type df -hagain to make sure that this partition is no longer listed. In the example, you should now see: Filesystem Size Used Avail Use% Mounted on/dev/hde2 54G 27G 24G 54% / none 506M 0 506M 0% /dev/shm/dev/hdf3 54G 39G 13G 76% /mnt/FC1See, no /boot partition! 8.What you type now depends on what type setting /boot had: ext2 or ext3:Type e2fsck -fy partition, such as e2fsck -fy/dev/hde1 reiserfs:Type reiserfsck –fix-fixable partition, such as reiserfsck –fix-fixable /dev/hde1, and if this gives you more errors, follow with reiserfsck –rebuild-tree partition, such as reiserfsck rebuild-tree /dev/hde19.Type exitand let the machine try to reboot. If the machine can reboot, you re done, yay! If not, return to Step 6 andrun through the process again. Sometimes, you actually need to try the fix more than once. If you reboot again at the end and it still fails, proceed. 10.Repeat Steps 1 and 4, but this time look for the lines that correspondto the / directory. In my example, /is mounted from /dev/hde2and is formatted usingext3. Unfortunately, you can t remove the / filesystem since it s got all ofyour commands! But, there is still a safe way to do this. 11.Type mount -o remount,ro /. This command releases the root (/) partition and then adds it again, butthis time as read-only so things won t be changing as you re working onit. That makes what you re about to do safe. 12.Repeat Step 8 for the / partition. So, for my example, the / partition is /dev/hde2, so you d be startingwith ext2fsck -fy /dev/hde2or reiserfsck –fix-fixable/dev/hde213.Repeat Step 9. Again, if it fails to reboot, repeat Steps 10 through 12 to see whether thatfixes things. Unfortunately, at this point, if the problem still occurs, it could be many, many things. Now is a good time to go to your local Linux Users Group (seeChapter 4) or online help site. 231Chapter 11: Checking Out the Linux Filesystem17_

Best web hosting - necessary at boot time, taking the need to

Thursday, November 8th, 2007

necessary at boot time, taking the need to do this out of your hands. Sometimes, however, if something went really wrong, you get this unnervingprompt that tells you to enter your password or press Control-D to continue. If this prompt appears, type your root (administrative) password, pressEnter, and the follow these steps. Don t worry; more often than not, you canactually fix this problem: Because it s a bit of an art at times trying to figure out which partition may bedamaged, I walk you through a process where you check the most likely onesto bring you to this state and then work through the rest in turn. 1.Type df -hto see a list of all your partitions. The dfcommand lists the mounted partitions and media in addition tosome statistics about them. You may, for example, see something likethe following: Filesystem Size Used Avail Use% Mounted on/dev/hde2 54G 27G 24G 54% / /dev/hde1 99M 6.0M 88M 7% /bootnone 506M 0 506M 0% /dev/shm/dev/hdf3 54G 39G 13G 76% /mnt/FC12.Look for an item with /bootin the right column. If you find one, great. Proceed to Step 3. Otherwise, skip to Step 10.3.On that same line, look on the left column to see what partition /bootis on. In this example, /bootis on /dev/hde1.4.Type mount. This command gives you something even more cryptic looking. In myexample, it may be/dev/hde2 on / type ext3 (rw) none on /proc type proc (rw) none on /sys type sysfs (rw) none on /dev/pts type devpts (rw,gid=5,mode=620) usbdevfs on /proc/bus/usb type usbdevfs (rw) /dev/hde1 on /boot type ext3 (rw) none on /dev/shm type tmpfs (rw) /dev/hdf3 on /mnt/FC1 type ext3 (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) 5.Locate the line with /booton it once again and look at what type isbeing used. In this case, /boot on /dev/hde1is formatted as type ext3. Keep thisin mind. You ll need to use this information in Step 8.6.Type umount /boot. This command should release the partition. 230Part III:Getting Up to Speed with Linux

Formatting DisksA floppy (Yahoo web hosting) disk, USB keychain, and any

Thursday, November 8th, 2007

Formatting DisksA floppy disk, USB keychain, and any other small(ish) storage device oftencomes as a blank slate orformatted for Windows or Macintosh use (mostoften these days they come formatted for Windows). If the item is a blankslate, no computer can use it for anything. You can actually just use the itemin Windows format with no problem, or you can format change its basesetup for Linux. (The handy thing about leaving it as a Windows disk isthat you can then use it to share things with Windows users). To format a floppy, place the floppy into your floppy drive and do the following: Fedora:ChooseApplications.System Tools.Floppy Formatter. Knoppix:Right-click the floppy icon on the desktop and chooseActions.Format Floppy Disk. Linspire:From the main menu, choose Programs.Utilities.FloppyFormatter. Mandrake:From the main menu, chooseSystem.Configuration. Hardware.KFloppy. SuSE:From the main menu, chooseSystem.Filesystem.KFloppy. Xandros:Open the Xandros File Manager (see Chapter 10), right-clickthe Floppy entry in the left section, and choose Format. You may have toclick the Floppy item first to open its contents before you can format it. Typically, the defaults are what you ll want to choose. If you want to formatthe disks for Linux, use the Linux Native (ext2) format. To share disks withWindows users, choose DOS (FAT). Another setting you may want to chooseis Thorough rather than Quick. Care and Feeding of Your FilesystemRegardless of which operating system you re using, you need to keep yourfilesystem healthy and happy. Everything that you need to operate themachine and do your work (or play) on it exists in that filesystem. Keep it ingood shape, and it s sure to treat you well in return. Fortunately, Linux doessome of it automatically for you. If your machine fails to rebootIf your machine didn t shut down cleanly (a nice euphemism meaning that iteither crashed or you shut the power off without properly telling the machineto shut down, as discussed in Chapter 5), the system checks the filesystem if229Chapter 11: Checking Out the Linux Filesystem17_

You probably see a (Web hosting provider) pattern by now. A

Wednesday, November 7th, 2007

You probably see a pattern by now. A hard drive has a three-letter designation: An IDE drive s designation starts with /dev/hd; the first drive of thistype is a, the second is b, and so on. The third IDE drive looks like this: /dev/hdc. If you re using something like a Promise controller thatbypasses the main IDE controllers (I know, this is technical stuff), thenyour first IDE hard drive will, in fact, show up as /dev/hde. I know thisone from personal experience! A SCSI drive s designation starts with /dev/sd; the first drive of thistype is also a, the second is b, and so on. The fourth SCSI drive looks likethis: /dev/sdd. USB drives are also seen as SCSI devices. A little itemlike a USB keychain is often seen as /dev/sda1by your system if youdon t have any permanent SCSI drives attached. The number that follows the three-letter designation represents the partitionyou re referring to. I cover partitioning your hard drive in Chapter 2. In Figure 11-1, I break down this concept, hopefully making it a bit moreaccessible. In this case, the user created three partitions for Linux. The firstIDE drive is a single partition, allocated for the rootpartition. The secondIDE drive is broken into two partitions. The first was given /usr; and thesecond, /var. If you move around the filesystem, you can t tell (and don t need to know) which of these directories is on which drive. The prompt, for example, doesn tchange based on which drive each directory is on; the commands used formoving around the filesystem (see Appendix A) don t care about the underly- ing hard drive or drives. WindowsA:FloppyB:CDROMFirstpartitionSecondpartitionFirst IDEdriveC: SecondIDEdriveD:E: Linux/mnt/floppyFloppy/mnt/cdromCDROMFirstpartitionSecondpartitionFirst IDEdrive/dev/hda1/ SecondIDEdrive/dev/hdb1/usr/dev/hdb2/varFigure 11-1: Linux versusWindows inhandlingpartitionsand harddrives. 228Part III:Getting Up to Speed with Linux

Web hosting companies - If you partitioned your hard drives on your

Tuesday, November 6th, 2007

If you partitioned your hard drives on your own, you know that you needed to specify a mount pointfor each partition which is like an empty spot in apuzzle, where the outside partition or media can be plugged into the rest ofthe filesystem. In the case of a hard drive partition that s part of your primaryfilesystem and added at boot time, the mount point isn t in the /mntor /mediapart of the filesystem. It s an item in the rootdirectory maybe /bootor /or/usr or anywhere else in your directory hierarchy (like /usr/share). Later, when you re working on the computer, you don t need to know or care aboutwhether the directories or files are all on one drive or are on multiple drives. You just do your thing. The times you do need to know how Linux sees the hardware are when you retrying to add new hard drives, install the machine while not using automaticpartitioning, or access temporary media. Table 11-4 lists a common breakdownof popular hardware designations. Note that these designations aren t in /mntor /media;they re in /dev. They re the actual device driver shortcuts whichpoint to the real drivers. These names are typically used for convenience sothat you don t have to remember exactly which driver to deal with. Table 11-4Common Drive DesignationsDesignationDescription/dev/cdromCD-ROM drive; if you have more than one, then you mayhave /dev/cdrom1and so on, and you also may see/dev/cdwriter, /dev/dvd, or even a hard drive des- ignation such as /dev/hda/dev/fd0Floppy drive 1/dev/fd1Floppy drive 2/dev/hdaFirst IDE hard drive/dev/hda1First IDE hard drive, first primary or extended partition/dev/hda2First IDE hard drive, second primary or extended partition/dev/hdbSecond IDE hard drive/dev/hdb1Second IDE hard drive, first primary or extended partition/dev/hdb2Second IDE hard drive, second primary or extended partition/dev/sdaFirst SCSI hard drive/dev/sda1First SCSI hard drive, first primary or extended partition, and often also a small USB drive like a thumbnail/keyringstorage device227Chapter 11: Checking Out the Linux Filesystem17_

To access something on one of your other (Web hosting domains)

Tuesday, November 6th, 2007

To access something on one of your other partitions (maybe a Windowspartition) click the My Computer icon on your desktop and then browsethrough the contents of your hard drive(s) which are representedhere with a separate icon for each partition. It may take some trial anderror to figure out, but you ll find what you re looking for. Navigating the filesystem in XandrosBecause Xandros is another distribution aimed at newcomers, you expect itto be easy to navigate. Here s how to find your way around in this one: When you insert a data CD, CD-ROM, DVD, or DVD-ROM, the XandrosFile Manager opens to its contents. You can remove this item by closingthe window and pressing the eject button on your computer. When you insert a music CD, a music player opens. When you insert a video DVD, a video player may or may not open. SeeChapter 18 for more on using multimedia. When you insert a blank CD or DVD writeable or re-writeable, a CD cre- ation window appears. When you insert a floppy, to access its contents, open the Xandros FileManager (see Chapter 10) and click the Floppy entry on the left. Whenyou re finished, close the window and eject the floppy using the buttonon the computer. To access something on your network, open the Xandros File Manager(see Chapter 10). Either select Windows Network or NFS (Unix/Linux) network on the left. To access something in your Linux filesystem, open the Xandros FileManager (see Chapter 10) and choose Go.All File Systems. To access something on one of your other partitions (maybe a Windowspartition), look for it on the left. Partitions versus DirectoriesOne very important thing to understand about the Linux filesystem is that itmay not all be on one single hard drive or hard drive partition, and yet youdon t have to keep track of what drive or partition it s on like you do in otheroperating systems. In the Microsoft Windows world, if you use separate harddrives or partitions, you have a specific letter designation for each one. Theprimary hard drive is C, the next is D, and so on. Under Linux, each of thesedrives and partitions quietly blends together. 226Part III:Getting Up to Speed with Linux

The Services section appears. 13.Click LAN Browser. The (Free web hosts)

Monday, November 5th, 2007

The Services section appears. 13.Click LAN Browser. The contents of your LAN appear. 14.Browse away. Continuing through the list of how to access various parts of yourfilesystem: To access something in your Linux filesystem, open the Konquerorfile browser. In its Location text box, type a /and press Enter. To access something on one of your other partitions (maybe aWindows partition), open the Konqueror file browser and type/dev/hdand select the appropriate option from the list. This maytake some trial and error at first (and it makes more sense in thesection Partitions versus Directories, later in this chapter). Navigating the filesystem in SuSESuSE is another distribution that offers some handy icons to make the brows- ing process more intuitive. To find your way around in SuSE: When you insert a data CD, CD-ROM, DVD, or DVD-ROM, a Konquerorwindow opens with the item s contents. You can remove the CD by clos- ing the window and pressing the eject button on your computer. When you insert a music CD or a video DVD, SuSE recognizes it as suchand asks whether it should open the item with a particular tool. ClickYes if you want it to do so, and No if not. If you want your choice to beyour default answer, make sure to click the Do Not Ask Again check boxto add the X. You may receive a message that DVD playback for all orparticular DVDs is disabled due to legal reasons. If so, see Chapter 18. When you insert a blank CD or DVD writeable or re-writeable, burningsoftware opens. See Chapter 18 for more on burning CDs and DVDs. When you insert a floppy, click the My Computer icon on your desktop, and then the Floppy icon, to access its contents. When you re finished, close the window and press the ejection button on your computer toremove the floppy. To access something on your network, click the Network Browsing iconon your desktop. To access something in your Linux filesystem, click the My Computericon on your desktop and look to the left hand vertical row of icons onthe window. Click the second up from the bottom (Root). 225Chapter 11: Checking Out the Linux Filesystem17_

Hosting your own web site - the item s contents. To remove the item from

Sunday, November 4th, 2007

the item s contents. To remove the item from the drive, right-click theicon and choose Eject. When you insert a music CD, the CD player launches with the CD loaded. When you insert a video DVD, nothing happens. See Chapter 18 for moreon multimedia. When you insert a blank CD or DVD writeable or re-writeable, burningsoftware opens. See Chapter 18 for more details. When you insert a floppy, you need to double-click the Floppy icon one of two filesystem icons on your desktop to access its contents. Toremove it, right-click the icon and choose Unmount. Accessing files on your network is a bit more complex: 1.Open the Mandrake Software Installer (see Chapter 12). 2.In the Search text box, type lisaand then click Search. The installer shows you all packages that have the text lisa in theirname. 3.Click the lisa box and click Install. The program asks you for the appropriate CD. 4.Place the CD into the drive, close the drive, and click OK. The installer adds the lisaprogram to your system. 5.Close the installer. 6.Click the monitor icon on your panel to open a command line termi- nal window. 7.In the terminal, type su - You re now in Mandrake as the root user. There s no password by defaultbut you can set one if you want. 8.Type /etc/init.d/lisastartThis action starts one of the two programs necessary to get easy net- work browsing working. 9.Open the Konqueror file browser from anywhere (see Chapter 10). 10.Choose Settings.Toolbars.Show Extra Toolbar. A new toolbar appears. 11.In the new toolbar, click the leftmost icon (Show Navigation Panel). The Navigation Panel appears. You can get rid of the extra toolbar now ifyou want. 12.In the Navigation Panel, click the bottom icon (Services). 224Part III:Getting Up to Speed with Linux

To access partitions and drives on your machine (Web server on xp)

Sunday, November 4th, 2007

To access partitions and drives on your machine that aren t part of yourLinux installation (like a Windows drive), click the various Hard DiskPartition icons until you find the one you re looking for. Navigating the filesystem in LinspireBecause Linspire is designed for the absolute newcomer, you expect itsfilesystem navigation to be a point-and-click snap, and indeed they ve made itpretty easy on you. To navigate your filesystem in this distribution: When you insert a data CD, CD-ROM, DVD, or DVD-ROM, Linspire opensa file browsing window with the item s contents. To remove the itemfrom your system, right-click its icon on the desktop and choose Eject. When you insert a music CD, the CD player launches with the CD loaded. When you insert a video DVD, if you don t have the (commercial) DVDplayer installed, Linspire opens a CNR window where you can purchasethis player. If you re a CNR member, the price is less than $5! When you insert a blank CD or DVD writeable or re-writeable, Linspiredoesn t do anything automatically. See Chapter 18 for how to burn CDsand DVDs. When you insert a floppy, you need to double-click the Floppy icon toaccess its contents this icon exists even if you don t have a floppydrive. When you re finished with the floppy, right-click the icon andchoose Unmount before you remove the disk. Don t remove the diskuntil the drive light turns off, when you can be sure that all the data issaved properly. To access something on your network, double-click the NetworkBrowser icon and browse away. Another option is to double-click the MyComputer icon and then double-click Network Shares. To access something in your Linux filesystem, double-click the MyComputer icon and then the System icon. To access something on one of your other partitions (maybe a Windowspartition), double-click the My Computer icon and then the appropriatedrive. Navigating the filesystem in MandrakeMandrake doesn t offer quite as many obvious shortcuts as the others. Tofind your way around: When you insert a data CD, CD-ROM, DVD, or DVD-ROM, Mandrake addsan icon to your desktop. You can then double-click that icon to access223Chapter 11: Checking Out the Linux Filesystem17_

has icons along the left of your desktop (Multiple domain web hosting)

Saturday, November 3rd, 2007

has icons along the left of your desktop for every drive and partition it finds. To help you find your way around: It s important to realize that because Knoppix is a bootable distribution, you already have a CD-ROM in use in the drive! If you only have oneCD/DVD-ROM drive, you re stuck. You can t eject Knoppix, because theCD is acting as your hard drive, containing all your programming. Here swhere a portable drive can come in handy. To use a floppy, place it in your floppy drive and then click the floppyicon to access its content. (If you re using a machine without a floppydrive, Knoppix fools you and puts a floppy icon on the desktop anyway!) You can then right-click the floppy and choose Actions.Unmount tosave everything before removing it from the drive. To access drives on your network: 1.Click the monitor icon on your panel to open a command lineterminal window. 2.In the terminal, type su -. You are now in Knoppix as the root user. There s no password bydefault, but you can set one if you want. 3.Type /etc/init.d/lisa start. This action starts one of the two programs necessary to get easynetwork browsing working. 4.Click any of the drive icons on your desktop. The Konqueror file browser opens. 5.Look to the left panel of icons on your Konqueror window andclick the bottom one (Services). The Services section of Konqueror appears. 6.Click LAN Browser. Now you have access to the computers that are offering sharedfolders on your network! 7.Browse away. To access your Linux filesystem: 1.Click any of the drive icons on your machine. The Konqueror file browser opens. 2.Look to the left panel of icons on your Konqueror window andclick the icon above the bottom one (Root Folder). Your root folder s contents appear. 3.Navigate at will! 222Part III:Getting Up to Speed with Linux