logo back up home forward   further reading more topics »

Programming - Command Line - Platforms

On this page I have put some information that I have found useful for sorting out problems:

Formatting Devices

When formatting flash drives I use 'ext2' to avoid too many writes to a given part of the drive.

Login myid@suse111:~> su root
Password:
find device id suse111:/home/martin # df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb2 20641788 11691664 7901484 60% /
udev 1671612 1068 1670544 1% /dev
/dev/sdb3 217642344 70041476 136544936 34% /home
/dev/sdg1 7807772 4 7807768 1% /media/disk
unmount suse111:/home/martin # umount /media/disk
format suse111:/home/martin # mke2fs /dev/sdg1
   

Mounting Devices

On my system the following devices are used (this will be different for other systems):

/dev/sda2 -- ntfs partition
/dev/sdb2 -- ext3 system partition
/dev/sdb3 -- ext3 home partition
/dev/sdc -- usb card device
/dev/sdd -- usb card device
/dev/sde -- usb card device - sd cards
/dev/sdf -- usb card device
/dev/sr0 -- cd/dvd drive

for more information for your system try running:

fdisk -l

or see the /etc/fstab file which is a text file.

Once you know the device name you can then mount the device by associating it with a disk file as follows:

mount /dev/sdb2 /mnt
mount /dev/sdb3 /mnt/home
mount -t vfat /dev/sde /mnt/sd
system partition
user partition
sd card device

we can also mount network devices as follows:

mount.cifs //192.168.0.4 /mnt/buffalo -o username=guest

Repairing File systems

Since file systems cannot be repaired from a running system you will probably need to run the rescue system. To do this put your SUSE disc into the disc drive and boot up your system, select 'rescue system' from the menu. This will take you into the command line but the disc partitions will not necessarily be mounted.

First we need to gather information about the disc, it really helps to run these commands when you first install the operating system, then you will have somthing to compare with if things go wrong:

  command
whole disk fdisk -l
  vi /etc/fstab
  sfdisk -d /dev/sdb > /tmp/partition.txt
individual ext2 or ext3 partition /sbin/dumpe2fs /dev/sdb3 | more
 

/sbin/e2fsck -n /dev/sdb3

or

/sbin/fsck.ext2 -n -f /dev/sdb3

   

I have more information with examples of the output on this page.

Checking logs

In order to check the logs from the command line try:

vi /var/log/boot.msg
vi /var/log/messages
boot logs
messages

Changing file permissions

Giving user write access after restoring from DVD

chmod o+w * -R

Commands

command description
cd change directory
rm -R * delete resursivly (warning - deletes entire contents of current directory and subdirectories)
rd remove directory (if empty)
   
   
   
   
   
   

 


metadata block
see also:
Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover Fedora, SuSE and Mandrake, Timesaving Techniques for Dummies.

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

 

Can this page be improved?

Please send me any improvements to here. I would appreciate ideas to make the pages more useful including error correction, ideas for new pages, improvements to wording. It helps if you quote the full URL of the page.

 

progam

I am working on a project which uses these principles, if you would like to help me with this you are welcome to join in, here:

for 3D programming: http://sourceforge.net/projects/mjbworld/

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2010 Martin John Baker - All rights reserved - privacy policy.