[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: utilizing unpartitioned space

>>>>> "Sanjay" == Sanjay Gupta <sanjay@xxxxxxxxxxxxx> writes:

    Sanjay> Hi !  I have some unpartitioned space which linux using
    Sanjay> "fdisk -ul" is showing as /dev/sd2 type ext2.

You probably mean "unused space".  Since it shows up in fdisk, it is
already partitioned.

    Sanjay> Now I want to make it a partition and use that space by
    Sanjay> mounting it to some directory say /home2

First check whether it already has a filesystem (i.e. is formatted) or not:

# mkdir /mnt/tmp
# mount /dev/sda2 /mnt/tmp
If mount succeeds then it is already formatted.  It might as well
contain some data.

Else format it with the command:
# /sbin/mkfs.ext2 /dev/sda2

Read your typed command before you press enter.  A small typo and you
could regret it for some time.

Now your filesystem is ready to be mounted! Add the following line to

/dev/sda2 /home2 ext2 defaults 1 2

Create the directory /home2 and give the command
# mount /home2

Hope that works,
Lokesh Setia.