15 January, 2012

fdisk command line partitioning on linux

Partitioning with fdisk

This section shows you how to actually partition your hard drive with the fdisk utility. Linux allows only 4 primary partitions. You can have a much larger number of logical partitions by sub-dividing one of the primary partitions. Only one of the primary partitions can be sub-divided.
Examples:
  1. Four primary partitions
  2. Mixed primary and logical partitions

1. fdisk usage

fdisk is started by typing (as root) fdisk device at the command prompt. device might be something like /dev/hda or /dev/sda.
The basic fdisk commands you need are:
p print the partition table
n create a new partition
d delete a partition
q quit without saving changes
w write the new partition table and exit
Changes you make to the partition table do not take effect until you issue the write (w) command. Here is a sample partition table:

Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes
 
   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1   *         1       184    370912+  83  Linux
/dev/hdb2           185       368    370944   83  Linux
/dev/hdb3           369       552    370944   83  Linux
/dev/hdb4           553       621    139104   82  Linux swap
The first line shows the geometry of your hard drive. It may not be physically accurate, but you can accept it as though it were. The hard drive in this example is made of 32 double-sided platters with one head on each side (probably not true). Each platter has 621 concentric tracks. A 3-dimensional track (the same track on all disks) is called a cylinder. Each track is divided into 63 sectors. Each sector contains 512 bytes of data. Therefore the block size in the partition table is 64 heads * 63 sectors * 512 bytes er...divided by 1024. The start and end values are cylinders.

2. Four primary partitions

The overview:
Decide on the size of your swap space  and where it to go . Divide up the remaining space for the three other partitions.
Example:
I start fdisk from the shell prompt:

# fdisk /dev/hdb 
which indicates that I am using the second drive on my IDE controller.
When I print the (empty) partition table, I just get configuration information.

Command (m for help): p

Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes
I knew that I had a 1.2Gb drive, but now I really know: 64 * 63 * 512 * 621 = 1281982464 bytes. I decide to reserve 128Mb of that space for swap, leaving 1153982464. If I use one of my primary partitions for swap, that means I have three left for ext2 partitions. Divided equally, that makes for 384Mb per partition. Now I get to work.

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-621, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-621, default 621): +384M
Next, I set up the partition I want to use for swap:

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (197-621, default 197):
Using default value 197
Last cylinder or +size or +sizeM or +sizeK (197-621, default 621): +128M
Now the partition table looks like this:

   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1             1       196    395104   83  Linux
/dev/hdb2           197       262    133056   83  Linux
I set up the remaining two partitions the same way I did the first. Finally, I make the first partition bootable:

Command (m for help): a
Partition number (1-4): 1
And I make the second partition of type swap:

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap)      
Command (m for help): p
The end result:

Disk /dev/hdb: 64 heads, 63 sectors, 621 cylinders
Units = cylinders of 4032 * 512 bytes
 
   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1   *         1       196    395104+  83  Linux
/dev/hdb2           197       262    133056   82  Linux swap
/dev/hdb3           263       458    395136   83  Linux
/dev/hdb4           459       621    328608   83  Linux          
Finally, I issue the write command (w) to write the table on the disk.
Command (m for help): w

10 June, 2011

Mobile version of morphus.dk


Mobile Template on morphus.dk

Yes. Right now you can see On mobile devices too,
.......like smart phones HTC, Iphone and so on,
.... see the mobile version of my template.

15 May, 2011

How do I recover the files from formatted hard drives?

TestDisk is powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting a Partition Table). Partition table recovery using TestDisk is really easy.

just run simply in terminal, type
# photorec

and follow instruction in terminal.
the recovery tool will see like screen-shot bellow

PhotoRec in action:


download your copy here

how to open tar.bz2 files ?

To extract a TAR.BZ2 file open up a console and type:

Code:
tar jxvf nameOfTarfile.tar.bz2 

20 February, 2011

PS3 Media Server for Ubuntu

PS3 Media Server is a DLNA compliant Upnp Media Server for the PS3,
written in Java, with the purpose of streaming or transcoding any kind of media files, with minimum configuration. It's backed up with the powerful Mplayer/FFmpeg packages.

Current features

  • Ready to launch and play. No codec packs to install. No folder configuration and pre-parsing or this kind of annoying thing. All your folders are directly browsed by the PS3, there's an automatic refresh also.
  • Real-time video transcoding of MKV/FLV/OGM/AVI, etc.
  • Direct streaming of DTS / DTS-HD core to the receiver
  • Remux H264/MPEG2 video and all audio tracks to AC3/DTS/LPCM in real time with tsMuxer when H264 is PS3/Level4.1 compliant
  • Full seeking support when transcoding
  • DVD ISOs images / VIDEO_TS Folder transcoder
  • OGG/FLAC/MPC/APE audio transcoding
  • Thumbnail generation for Videos
  • You can choose with a virtual folder system your audio/subtitle language on the PS3!
  • Simple streaming of formats PS3 natively supports: MP3/JPG/PNG/GIF/TIFF, all kind of videos (AVI, MP4, TS, M2TS, MPEG)
  • Display camera RAWs thumbnails (Canon / Nikon, etc.)
  • ZIP/RAR files as browsable folders
  • Support for pictures based feeds, such as Flickr and Picasaweb
  • Internet TV / Web Radio support with VLC, MEncoder or MPlayer
  • Podcasts audio/ Video feeds support
  • Basic Xbox360 support
  • FLAC 96kHz/24bits/5.1 support

04 February, 2011

how to remove a user in ubuntu debian (unix)

to remove a user and their home directory, use:

sudo deluser -remove-home

to remove all of their files on the server:

sudo deluser -remove-all-files

07 December, 2010

How do add users to sudoers list?

Tired of getting told that I'm not in the sudoers file. How do I add myself to it, and is there any reason that I wouldn't want to?

sudo - Debian Wiki
http://wiki.debian.org/sudo

SUDO Configuration in Debian
http://www.debianhelp.co.uk/sudo.htm

Debian User Forums • View topic - Proper way to open apps as root in X
http://forums.debian.net/viewtopic.php?f=16&t=53366

Switch over to root and type visudo. The benefit of using visudo is that it will check syntax and whatever else and warn you of any problems you may have introduced into the sudoers file.

Code:
su -
visudo
visudo shows me that there is a group I could place myself into called 'sudo'. So instead of fooling around in the sudoers file add yourself to the 'sudo' group if you like ... that's what I've done.

Code:
%sudo ALL=(ALL) ALL
To add your normal user (morphus) to this group:

Code:
su -
usermod -a -G sudo morphus
The 'morphus' user will have to provide his/her password to issue system commands using sudo.


06 November, 2010

how to remove symbolic-link (ln -s) on Linux

remove symbolic-link (ln -s) in terminal

When you create a link with "ln -s", then you can remove the link with a simple "rm"

"rm ACTUAL_FILE" removes the actual file, "rm SYM_LINK" removes the symbolic link

rm -rf /usr/src/linux

27 September, 2010

Cherokee webserver Couldn't find interpreter....PHP ....



cherokee complains about php not installed

1.default cherokee.conf has references to php interpreter
source_interpreter.c:290: ERROR: Couldn't find interpreter 'php-cgi -b /tmp/cherokee-php.socket'

(cherokee: it doesn't ask to install php5-cgi too)

you need to install php5-cgi
and restart cherokee

30 August, 2010

3G Iphone froze at Apple Screen, no way to restart it or sync it

issue about hung up at the apple screen while updating and when I reboot it just goes back to the apple and never boots up. I've connected my computer and Itunes doesn't find the iphone.

Possible solution I've tried was , hold power button and then the home button for 5 seconds, then you will power down your Iphone, then power you iphone up again, and connect to itunes software and you will be asking for restoring your Iphone to factory settings, say Yes, and restoring progress will begin, then you can try to update your iphone again. it should complete the updates without problem.