Latest Post

09:44

Configuring Yum in RHEL5

In this article I am going to discuss how we can configure Yum for DVD sources in RHEL5.
Yum is the package management tool used these days. It has replaced the old "up2date" command which use to come with RHEL4. This command used to get updates from the RHN (Redhat Network) for the installed operating system, if the user using that command had bought a support/update entitlement from Redhat. But with the new version of Redhat and then it's free clone Centos5 "up2date" has been dropped out and instead of it "yum" as been included. "yum" was there in Fedora core for a long time and was use to update packages via 3rd party repositories. It started becoming mature with Fedora and now finally when Redhat thought it to be matured enough to make it's way into RHEL it's here.

The major problem one face with Yum is to configure it for DVD/CD sources. Yum by default doesn't comes enabled for these sources and we need to explicitly enable it. I don't know what is the reason behind not enabling Yum for these sources by default but, whatever it is we can still hack "yum" on our own and can configure it to use DVD/CD install sources.

Before starting I would like to mention that I am using a DVD source in this article which is represented by "/dev/dvd" and mounted on "/media/cdrom". The steps I tell here can be easily extended for CD sources as well. Later in this article I will tell how we can configure a local yum repository and use it for package management in our LAN clients.

First of all you have to put in the media CD/DVD into your CD/DVD ROM/Writer. Then you need to mount it manually if you are login via root user in a GUI. To do so

mount /dev/dvd /media/cdrom

After mounting the DVD we need to copy the content of the DVD onto a directory. For example I have a directory /dvd/rhel5/. I will copy the whole contents of /media/cdrom into /rhel5. This is the command

cp -r /media/cdrom/* /dvd/rhel5/

After copying the contents it's time to do some modifications. First of all we need to bring the xml files defining the groups to directory one level higher.

mv /dvd/rhel5/Server/repodata/comps-rhel5-server-core.xml /dvd/rhel5/Server
mv /dvd/rhel5/VT/repodata/comps-rhel5-vt.xml /dvd/rhel5/VT
mv /dvd/rhel5/Cluster/repodata/comps-rhel5-cluster.xml /dvd/rhel5/Cluster
mv /dvd/rhel5/ClusterStorage/repodata/comps-rhel5-cluster.xml /dvd/rhel5/ClusterStorage


Now we need to delete the repodata/ directories which comes with the default install tree. The reason behind this is that in their xml files we have a string
xml:base="media://1170972069.396645#1" .....
This string is present in repmod.xml as well as primary.xml.gz. This thing creates problem with using DVD/CD sources with yum. So we need to do the following

rm -rf /dvd/rhel5/Server/repodata
rm -rf /dvd/rhel5/VT/repodata
rm -rf /dvd/rhel5/Cluster/repodata
rm -rf /dvd/rhel5/ClusterStorage/repodata

After we have deleted the default repodata/ directories it's time to re-create them using the "createrepo" command. Now this command doesn't comes by default I guess so we need to install it's rpm

rpm -ivh /dvd/rhel5/Server/createrepo-0.4.4-2.fc6.noarch.rpm

Next step is to run this command. Before running this command we need to switch to the /dvd/ directory. Then run the commands listed below

createrepo -g comps-rhel5-server-core.xml dvd/Server/
createrepo -g comps-rhel5-vt.xml dvd/VT/
createrepo -g comps-rhel5-cluster.xml dvd/Cluster/
createrepo -g comps-rhel5-cluster-st.xml dvd/ClusterStorage/

The above commands will do most part of the job. Now it's time to configure the /etc/yum.conf for our local repository. Note that we can also create separate repo files in /etc/yum.repos.d/ directory but I have tried it without any luck. So do the following

vi /etc/yum.conf

In this file type in the following: # PUT YOUR REPOS HERE OR IN separate files named file.repo

# in /etc/yum.repos.d
[Server]
name=Server
baseurl=file:///dvd/rhel5/Server/
enabled=1
[VT]
name=Virtualization
baseurl=file:///dvd/rhel5/VT/
enabled=1
[Cluster]
name=Cluster
baseurl=file:///dvd/rhel5/Cluster/
enabled=1
[ClusterStorage]
name=Cluster Storage
baseurl=file:///dvd/rhel5/ClusterStorage/
enabled=1

We can also use GPG key signing. For that write on top of the above lines

gpgenabled=1
gpgkey=file:///dvd/rhel5/RPM-GPG-KEY-fedora file:///dvd/rhel5/RPM-GPG-KEY-fedora-test file:///dvd/rhel5/RPM-GPG-KEY-redhat-auxiliary file:///dvd/rhel5/RPM-GPG-KEY-redhat-beta file:///dvd/rhel5/RPM-GPG-KEY-redhat-former file:///dvd/rhel5/RPM-GPG-KEY-redhat-release

This will be sufficient for now. Let's create the yum cache now.

yum clean all
yum update


It's all done now. We can now use "yum" command to install/remove/query packages and now yum will be using the local yum repository. Well I am mentioning some of the basic "yum" commands which will do the job for you for more options to the "yum" command see the man page of "yum".
yum install package_name Description: Installs the given package
yum list Description: List's all available package in the yum database
yum search package_name Description: Search for a particular package in the database and if found print's a brief info about it.
yum remove package_name Description: Remove's a package.

Now I will mention the steps you can use to extend this local repository to become a local http based repository so that LAN clients can use it for package management. I will be using Apache to configure this repository as it's the best available software for this job. Do configure the repository for http access via LAN clients we need to make it available to them. For that I am declaring a virtualhost entry in apache's configuration file. This is how it looks for me


ServerAdmin webmaster@server.example.com
ServerName server.example.com
DocumentRoot "/dvd/rhel5/"
ErrorLog logs/server.example.com-error_log
CustomLog logs/server.example.com-access_log common



After this service httpd start
chkconfig httpd on

Now it's time to make a yum.conf file that we will use at the client end. I am writing my yum.conf for clients. You can use it and modify according to your setup.

[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
plugins=1
metadata_expire=1800
gpgcheck=1

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[Server]
name=Server
baseurl=http://192.168.1.5/Server/
enabled=1
[VT]
name=Virtualization
baseurl=http://192.168.1.5/VT/
enabled=1
[Cluster]
name=Cluster
baseurl=http://192.168.1.5/Cluster/
enabled=1
[ClusterStorage]
name=Cluster Storage
baseurl=http://192.168.1.5/ClusterStorage/
enabled=1

Copy this file to /etc/ directory of the client end and replace it with the original file there. After copying is done it's time to do this

yum clean all
yum update
rpm --import /etc/pki/rpm-gpg/*

Now you can use yum on the client end to just install any package and it will communicate with the local repo server to get the package for you. You can also use pirut in the same way to get things done.

So this is how we can configure Yum for RHEL5 Server and can also use it to create our own local repo server for the LAN. Hope you have enjoyed reading and had your hands done on this :).





11:14
One of the biggest reasons why some organizations resist the move to Linux is the lack of applications available for Linux users—or, more specifically, the lack of Windows applications. However, just because you want to run Linux as your operating system, that doesn't mean you have to abandon your favorite Windows application. You might be able to get it to run on Linux using WINE.

What's WINE?
WINE is an ongoing project that is intended to allow Linux users to run Windows applications in a Linux environment. Although not all Windows applications will run under WINE, WINE is undergoing constant changes and many Windows applications can now be made to run under WINE.

Why WINE?
Although there are quite a few Windows applications that just don’t work with WINE and other Windows applications that install on WINE but crash frequently, there are still several reasons for using WINE. The biggest reason is to get away from Windows. Let’s face it, it’s easy to get an office suite for Linux, but most companies are unable to completely make the transition to Linux from Windows because they have a couple of mission-critical applications that simply do not run under Linux.

Companies might want to move from Windows to Linux for a number of reasons. For starters, there have been rumors that Microsoft has been considering adopting a software license model, which requires you to lease all of your Microsoft software on an ongoing basis. Many companies simply could not afford to do this. Running Linux and WINE would release you from the Microsoft monopoly.

Another reason for making the switch is because of all of the security holes in Windows. If a hacker group managed to find a major vulnerability in Windows, it would be theoretically possible to exploit that vulnerability on 80 percent of the world’s computers. However, if you switched to Linux and ran WINE, you would not be affected by any vulnerabilities that might exist within the Windows operating system because you would not be running Microsoft code.

Please note that I’m not writing this article to debate which is the better operating system. I only want to point out that there are some valid reasons why companies that have already rolled out Linux to a limited degree may want to press forward in their transition.

OK, so there are some reasons why it might be desirable to run Windows programs on Linux, but why use WINE? Why not just use an emulator such as VMWare? The truth is that when WINE works, it outperforms VMWare. Furthermore, if you want to emulate a Windows virtual machine, VMWare requires you to purchase a copy of Windows to install within the virtual machine. While it’s true that VMWare works really well, you are actually running an operating system on top of an operating system (Windows on top of Linux). This makes for some really slow performance. By the time that you pay for a copy of VMWare and the high costs associated with running Windows, running VMWare tends to be a bit pricey too.

WINE, on the other hand, is not an emulator. WINE simply uses a WIN32 API to make Windows code run on a native Linux / X Windows system. In theory, adding an extra layer of abstraction should slow things down a little bit. However, assuming that you have decent hardware, Windows applications running under WINE should perform comparably to native Linux applications. This raises the question of what constitutes decent hardware.

Hardware requirements
WINE’s hardware requirements are minimal to say the least. The first requirement is that WINE requires an X86 processor. A common misconception is that WINE is an emulator and can, therefore, run Windows applications on other platforms, such as Solaris. This is simply not true. In fact, the name WINE is an acronym that stands for Wine Is Not an Emulator. Because WINE is not emulating an X86 processor, an actual X86 processor is required.

To be more specific, WINE requires a minimum of an 80386 processor. The 80386 processor addresses memory in a very different way from prior Intel processors, and WINE depends on these differences. Even though WINE will technically run on an old 386 machine, don’t expect to be able to dig an old 386 with a 20 MB hard driver out of the closet and run WINE on it. WINE requires a whole lot more hard disk space than the low processor requirements might lead you to expect. You will need at least 250 MB of disk space just to store and compile the WINE source code. Additionally, the installation requires about another 70 MB of disk space, 20 MB of which must be available within your TMP directory.

It seems that the jury is still out on WINE’s memory requirements. There is a lot of contradictory information on the Internet regarding WINE’s memory requirements. The one thing that all of the sites do agree on though is that WINE’s debugger is memory hungry. One Web site claimed that it is possible, but not advisable, to run WINE with 8 MB of RAM and an 8-MB swap file. Another Web site suggested that 16 MB of RAM was the minimum but that WINE was painfully slow even with 24 MB of RAM. There seems to be a general consensus, though, that WINE will do a decent job of running most supported Windows applications if the computer has at least 64 MB of RAM.

Obtaining and installing WINE
Installing and configuring WINE takes a lot of work. The first step in the process is to download the WINE binaries. You can download the binaries from the WINE HQ Web site. The installation process differs depending on your Linux distribution type.

Linux distributions from Red Hat, Mandrake, and many others require you to install the binaries through the RPM command. To do so, you would enter the following command:
RPM –I WINE-xxxxxxxx-I386.RPM

In this command, xxxxxxxx represents the version number of the WINE RPM file that you have downloaded.

If you are using a Debian-based Linux distribution, you will use a different command to install the WINE binaries. The command is:
APT-GET INSTALL WINE

Whichever technique you use, the WINE binaries will be installed in the /USR/LOCAL folder unless you specify a different location.

Configuring WINE
Before you can use WINE, you must verify that the WINE configuration file is in the correct location. Most of the time it won’t be. After the initial installation, the configuration file will exist within the /URS/SHARE/DOC/WINE-xxxxxxxx/SAMPLES folder. You must copy this file to the ~/.WINE folder. To do so, you would enter the two commands shown below. The first command creates the ~/.WINE/ folder while the other copies the configuration file.
MKDIR ~/.WINE/
CP /USR/SHARE/DOC/WINE-xxxxxxxx/SAMPLES/CONFIG ~/.WINE/CONFIG


The configuration file has a lot to do with how well or even if an application will run. The default configuration file will work fine for a lot of applications, but there are times when you may want to tweak it. Tweaking the configuration file is beyond the scope of this article, but if you would like to see how it’s done, check out the directions found at the WINE Web site.

Installing and running Windows applications
Now that WINE is installed, you are probably anxious to try running a Windows application. Unlike Linux, most Windows applications have an executable Setup program. Usually this application is named SETUP.EXE, but the name does occasionally vary.

To install a Windows application, the first thing that you have to do is to make the CD that contains the application available to Linux. You can do so by using the following two commands:
MOUNT /DEV/CDROM
CD /DEV/CDROM


Now, simply issue the WINE command followed by the name of the Windows executable that you want to run (usually SETUP.EXE). The command would look like this:
WINE SETUP.EXE

When you run SETUP.EXE, you will launch the installation wizard for the application. Just follow the various prompts to complete the installation. If Setup completes successfully, then you are ready to run your Windows application. The next section of this article explains exactly how to go about doing so. If the Setup program crashes or hangs, though, then you will have to do a little clean up work.

If you have a Setup program that has hung, then the first thing that you must do is to press [CTRL][Alt][F1] to return to the main console screen. Now, login as root and then use the following command to kill the hung process:
KILLALL -9 WINE

This should terminate any processes that are running under WINE, but the process doesn’t always work. You must verify that the WINE-related processes have indeed been terminated. You can do so by issuing the following command:
PS-AX

This will list the currently running processes. If any WINE processes are listed, then pay attention to the process ID. Now, issue the following command where yyy is the process number for the process that you need to terminate:
KILL -9 yyy

Running a Windows application
Now that I have shown you how to set up a Windows application, let’s take a look at how to run the application once it has been installed. I recommend starting out with something simple. Try running Notepad. Notepad is actually built in to WINE and you can run Notepad just by entering NOTEPAD at the command line. If Notepad runs, then it means that your configuration file is set up correctly and you can try running a more elaborate application.

Basically, running a Windows application involves switching to the Windows directory, and then calling WINE along with the application name. In the example below, I am using APDIR to represent the name of the folder where my fictitious Windows application is installed. I am also using APPLICATION.EXE to represent the application’s executable. With this in mind, you would launch your Windows application by using the following two commands:
CD /APDIR
WINE APPLICATION.EXE – APPLICATION.EXE –CONSOLE


Troubleshooting
If Notepad fails to run, then WINE hasn’t been installed or configured correctly. In order to work, WINE requires some specific directories to be present beneath the .WINE/ directory. Normally, these directories should be automatically created during the installation process, but you can check to make sure that the directories actually exist. If they don’t exist, try creating them manually. The necessary directories include:
  • .wine/c_drive
  • .wine/c_drive/Windows
  • .wine/c_drive/Windows/Fonts
  • .wine/c_drive/Windows/Start Menu/Programs
  • .wine/c_drive/Windows/System
  • .wine/c_drive/Windows/System32
  • .wine/c_drive/Windows/Temp
  • .wine/c_drive/Program Files
  • .wine/c_drive/Program Files/Common Files

In case you are wondering, Linux doesn’t use drive letters (C:, D:, etc.) the way that Windows does. Windows applications expect to have access to a lettered drive. WINE treats the .WINE/C_DRIVE folder as the C: drive.

Another thing to check for is for the existence of the SYSTEM.INI and WIN.INI files within the .WINE/WINDOWS directory. Again, these files should already exist, but if they don’t, you can copy them from the WINE-xxxxxxxx/DOCUMENTATION/SAMPLES directory.

Earlier, I briefly mentioned the WINE configuration file. You shouldn’t normally have to change anything in the configuration file to get Notepad to run. If Notepad doesn’t run, though, you might check to make sure that the correct paths are specified within the configuration file. This is also a good time to make sure that the configuration file has the correct map point for the CD-ROM drive. The CD-ROM drive’s map point doesn’t really have anything to do with Notepad running or not running, but checking the map point now may save you some troubleshooting later when you try to run a real application.

Installing TrueType fonts
One of the biggest problems with using WINE to run a Windows application is that many Windows applications rely on TrueType fonts. As you may know, TrueType fonts are not natively supported by WINE. Therefore, if you have an application that is TrueType-font dependent, you’ll have to make Linux know what to do with TrueType fonts.

The easiest method for doing this is to download an X font server for TrueType fonts called XFSTT. If you need the RPM file, you can get it from this RPM resource xfstt page.

Once you download and install the TrueType font server package, you will have to copy the TrueType fonts off of a Windows machine to your Linux machine. If you had a dual boot machine, the steps for copying the TrueType fonts from Windows to Linux might look something like this: (Keep in mind that the steps below assume that you are using the directory name c_drive as the C: drive for WINE.)
MKDIR -P /C_DRIVE/WINDOWS/FONTS
MOUNT /DEV/HDA1 /DOS
CP /DOS/WINDOWS/FONTS /C_DRIVE/WINDOWS/FONTS
CD /C_DRIVE/WINDOWS/FONTS
TTMKFDIR >FONTS.DIR
CHKFONTPATH --ADD /C_DRIVE/WINDOWS/FONTS


At this point, you must restart the font server. You can do so by issuing the following command:
/ETC/RC.D/INIT.D/XFS RESTART

The TrueType fonts should now be accessible to X Windows. One way to tell for sure is by running XFONTSEL to see which font families are available. You can do so with the following command:
XFONTSEL &

Keep in mind that WINE is dependent on both Linux and X Windows. Unless TrueType fonts are functional within X Windows, they will not work with WINE.

Leaving Windows behind for good
As you can see, there are situations where it may be more advantageous to run a Windows application on a Linux box than on a Windows box. In these situations, it is more cost effective and more efficient to use WINE than a Windows emulator. WINE may not be perfect, but if you're intent on running Windows applications while leaving Windows itself behind, WINE may be the way to go.

10:48
To list all the users who can access a Linux machine we have to access the /etc/passwd file, which stores information about all registered users of that machine. But it is not really so easy as told above since the file contains many other fields & machine trust accounts & inbuilt accounts.

We'll start by
cat /etc/passwd

As we all know that by default all the users created will have their home directories in /home share so we'll modify our command a bit by using grep. Now it'll be
cat /etc/passwd | grep "/home"

Now we'll get all the user accounts which have their home share in /home.But the only output we need is the list of users & nothing else. So we'll modify our command again
cat /etc/passwd | grep "/home" |cut -d: -f1

Now what we have done is that we have piped the output of previous command to another variable "cut"

What we have done here is we have added cut -d: -f1
-d: means delimiter :
-f1 means display first field of line i.e. username.

So final command is
cat /etc/passwd | grep "/home" |cut -d: -f1
This works until all your users have their home share in /home. If you have defined their home share to some other destination. Modify the above command accordingly.

10:27
How can I add a user to a group under Linux operating system?

You can use the useradd or usermod commands to add a user to a group. The useradd command creates a new user or update default new user information. The usermod command modifies a user account i.e. it is useful to add user to existing group. There are two types of group. First is primary user group and other is secondary group. All user account related information is stored in /etc/passwd, /etc/shadow and /etc/group files to store user information.

useradd Example - Add A New User To Secondary Group

You need to the useradd command to add new users to existing group (or create a new group and then add user). If group does not exist, create it. The syntax is as follows:
useradd -G {group-name} username
In this example, create a new user called prem and add it to group called developers. First login as a root user (make sure group developers exists), enter:
# grep developers /etc/group
Output:
developers:x:1124:
If you do not see any output then you need to add group developers using groupadd command:
# groupadd developers
Next, add a user called prem to group developers:
# useradd -G developers Prem
Setup password forv user Prem:
# passwd Prem
Ensure that user added properly to group developers:
# id Prem Output:
uid=1122(Prem) gid=1125(Prem) groups=1125(Prem),1124(developers)

Please note that capital G (-G) option add user to a list of supplementary groups. Each group is separated from the next by a comma, with no intervening whitespace. For example, add user jerry to groups admins, ftp, www, and developers, enter:
# useradd -G admins,ftp,www,developers jerry

useradd example - Add a new user to primary group

To add a user tony to group developers use following command:
# useradd -g developers tony
# id tony

Sample outputs:
uid=1123(tony) gid=1124(developers) groups=1124(developers)
Please note that small -g option add user to initial login group (primary group). The group name must exist. A group number must refer to an already existing group.

usermod example - Add a existing user to existing group

Add existing user tony to ftp supplementary/secondary group with usermod command using -a option ~ i.e. add the user to the supplemental group(s). Use only with -G option :
# usermod -a -G ftp tony
Change existing user tony primary group to www:
# usermod -g www tony

10:18 1

How-To: Recover root password under linux with single user mode

It happens sometime that you can't remember root password. On Linux, recovering root password can be done by booting Linux under a specific mode: single user mode.
This tutorial will show how to boot Linux in single user mode when using GRUB and finally how to change root password.
During normal usage, a Linux OS runs under runlevels between 2 and 5 which corresponds to various multi-user modes. Booting Linux under runlevel 1 will allow one to enter into a specific mode, single user mode. Under such a level, you directly get a root prompt. From there, changing root password is a piece of cake.

1. Entering runlevel 1

Some Linux distribution, such as Ubuntu for instance, offer a specific boot menu entry where it is stated "Recovery Mode" or "Single-User Mode". If this is your case, selecting this menu entry will boot your machine into single user mode, you can carry on with the next part. If not, you might want to read this part.
Using GRUB, you can manually edit the proposed menu entry at boot time. To do so, when GRUB is presenting the menu list (you might need to press ESC first), follow those instructions:
  • use the arrows to select the boot entry you want to modify.
  • press e to edit the entry
  • use the arrows to go to kernel line
  • press e to edit this entry
  • at the end of the line add the word single
  • press ESC to go back to the parent menu
  • press b to boot this kernel
The kernel should be booting as usual (except for the graphical splash screen you might be used to), and you will finally get a root prompt (sh#).
Here we are, we have gained root access to the filesystem, let's finally change the password.

2. Changing root password

As root, changing password does not ask for your old password, therefore running the command:
# passwd
will prompt you for your new password and will ask you to confirm it to make sure there is no typo.
That's it, you can now reboot your box and gain root access again

11:01
he Linux command line is one of the most versatile tools you will ever use. It can do just about anything you can image for a machine. With such a large scope of tasks you can imagine just how much there is to learn. So, it’s always good  to have an arsenal of tricks at your fingertips.
So…let’s take a look at some nifty trickery with the Linux command line.

seq
This is one of the coolest (and most useful) tips I have ever come across.  The seq command will print out a sequence of numbers. So if you issue the command:
seq 0 50
You will see the numbers 0-50 printed out on the terminal. Very simple. Sure that’s great but what good is a sequence of numbers? Let’s apply it and find out. Remember you can always declare a value in bash and by making use of the $ symbol you can use variables in your commands. So what happens if you issue the command:
for k in `seq -w 1 50` ; do ssh 192.168.100.$k uptime ; done
What happens is ssh will walk through all the addresses from 192.168.100.1 to 192.168.100.50 until it finds one with an ssh server accepting connections. When it does it will ask you for the users password and then print out the uptime of that machine. Very handy indeed.

How much space left?
Quick, how much space do you have left on your drive(s)?  And where are those drives mounted on? Do you have the answer yet? If you had a terminal window open you could have issued the command df -h and you would have seen, in a user-friendly format, the percentage of your hard disk space that has been used. Very handy command.

Those pesky bash colors
Do you prefer the colors you see in bash? Do you even know about the colors in bash? From the command line issue the command ls you will see that files are black, folders are blue, executables are green (that’s a simplistic explanation). What if those colors bother you (or cause your pretty transparent terminal from giving you a good read on your file listing)? You can turn that off easily from the command by issuing:
ls --color=none
Of course that is a one-time deal. In order to make this permanent you have to edit your ~/.bashrc file. In that file you will see the following entry:
alias ls='ls --color=auto'
Comment out that entry and ls will no longer use color.

Find files modified TODAY
If you have saved a file today and you can’t remember where you saved it, you can use the find command to print out all files modified today. The command:
find ~ -type f -mtime 0
Will print out a listing of all files that were modified on the day the command was issued (today).

Install from source to package
That might not make any sense. It will in a moment. Say you’ve downloaded the source for a package that you want to install, but you want to keep with the standard for your distribution by installing it from a package (so your package manager is aware of it). You can do this with the help of the checkinstall application. This isn’t installed by default, but you can install it with the command sudo apt-get install checkinstall. Once installed you can install from source with the command (from within the source code directory):
./configure && make && checkinstall
This will ask you some questions regarding your distribution and will install the application.

10:57

1. Detecting USB hard drive

After you plug in your USB device to your USB port, linux will add new block device into /dev/ directory. At this stage you are not able to use this device as the USB filesystem needs to be mouted before you are able to retrieve any data. To find out what name your block device file have you can run fdisk command:
 
# fdisk -l 

You will get output similar to this:
 
Disk /dev/sdb: 60.0 GB, 60060155904 bytes
255 heads, 63 sectors/track, 7301 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000b2b03

Device Boot Start End Blocks Id System
/dev/sdb1 1 7301 58645251 b W95 FAT32

2. Creating mount point

Create directory where you want to mount your device:
 
mkdir /mnt/sdb1 

3. Edit /etc/fstab

To automate this process you can edit /etc/fstab file and add line similar to this:
/dev/sdb1       /mnt/sdb1           vfat    defaults        0       0 

Run mount command to mount all not yet mounted devices. Keep in mind that if you have more different USB devices in you system, device name can vary!!!
 
# mount -a 

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget