Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-11-2004, 03:50 PM   #1
LQ Newbie
Registered: Sep 2004
Location: NM
Distribution: Slackware
Posts: 6

Rep: Reputation: 0
Partioning and formatting HDD

Hello everyone I'm new to Linux and I need some help with
formmating and mounting partions in liunx.
I would greatly appreciate any help I can get. I'm trying to combine two partitions toghether I have the folowing partitions.

dev/hda1 primary linux 1.0 GB Boot
/dev/hda2 primary linux swap 512 MB
/dev/hda3 primary linux 3.0 GB
/dev/hda4 extended
/dev/hda5 linux 512 MB
/dev/hda6 linux rest of the disk

/ on /dev/hda1
/usr on /dev/hda3
/home on /dev/hda5
/extra on /dev/hda6

and I would like to combine home and extra into one partition and mount it under /hikito

and modify fstab and remove / comment out of the 2 old partitions

I would also like to make it ext3 file system on the new partiton and
fstab and add the /hikito

I ve tried to do this on my own but I can't I new to Linux Please Help!
Old 09-11-2004, 04:07 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,684

Rep: Reputation: 230Reputation: 230Reputation: 230
It looks like hda5 and hda6 are next to each other. It's a good sign. With partitions divided by another it's much harder.

Th easiest way will be to delete them both and create a new partition. So before you begin, copy all your data from the two to a safe place!

You can do the whole thing using fdisk. So:
fdisk /dev/hda
(you can list your partitions using the 'p' key or read the list of commands using 'm')
press 'd' (to delete a partition)
then press 5 to delete hda5
do the same with hda6
Then press 'n' to create a new partition, choose 'l' (logical), accept default values for begin and end (will take the whole free space).
Then press 'p' to see current scheme. Check if it is what you want. Then use 'w' to save the changes.

It's done in fdisk. Use
mkfs.ext3 /dev/hda5
to format it (it will probably be hda5).

Now edit fstab. The line for your new partition should be
/dev/hda5 /hikito ext3 defaults 1 2

To comment out the ld ones, simply put # at the beginning of the lines they're described in.
Old 09-11-2004, 04:30 PM   #3
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

Rep: Reputation: 30
Hi Hikito/Morgan

Welcome to LQ! I haven't been here for a while myself, but I'll try to help you.

First make sure that you don't have anything that you want to keep on partition 5 or 6. Any data there will be destroyed by following this procedure!

If the partitions are mounted, they need to be unmounted now:
> umount /dev/hda5
> umount /dev/hda6

Then enter fdisk:
> /sbin/fdisk /dev/hda
'm' will print a help menu for you.
Use the command 'd' to delete partitions 5 and 6, then use 'n' to add a new partition. Since you want the new partition to fill up the disk, just use the default values for first and last cylinders. 'w' will write the partition to disk and exit fdisk. (You can chicken out with 'q')

Now use
> /sbin/mkfs.ext3 /dev/hda5
to create a file system on your new partition.

Make an empty directory
> mkdir /hikito

Only the partition table left and we're done! Open /etc/fstab in a suitable text editor (emacs is always a suitable text editor, by the way ). Comment out the lines for the removed partitions. This is done by adding a '#' character at the beginning of the lines. Add this line:
/dev/hda5               /hikito             ext3    defaults        1 2
Save the file, reboot and enjoy.

Hope I didn't forget anything. Good luck!
Old 09-11-2004, 04:32 PM   #4
Registered: Nov 2003
Location: Ronneby, Sweden
Posts: 555

Rep: Reputation: 30
You type quicker than I do, Mara

Seems that we agree on the solution though ...

Old 09-11-2004, 04:35 PM   #5
LQ Newbie
Registered: Sep 2004
Location: NM
Distribution: Slackware
Posts: 6

Original Poster
Rep: Reputation: 0

Thanks Mara and MartinN It worked Thanks a lot

Best Regards




Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Partioning your HDD? mhelliwell Mandriva 2 03-16-2005 06:56 PM
Formatting Linux HDD alex101 Mandriva 1 04-25-2004 12:02 PM
Formatting a Laptop HDD Haggy Linux - Laptop and Netbook 2 01-01-2004 03:02 AM
Help for formatting external hdd !! sudhir Linux - Hardware 4 12-12-2003 12:30 AM
formatting HDD mrengc Linux - Newbie 1 01-10-2003 02:06 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration