LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-11-2004, 02:50 PM   #1
Hikito
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, 03:07 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
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, 03:30 PM   #3
MartinN
Member
 
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:
Code:
/dev/hda5               /hikito             ext3    defaults        1 2
Save the file, reboot and enjoy.

Hope I didn't forget anything. Good luck!
Martin
 
Old 09-11-2004, 03:32 PM   #4
MartinN
Member
 
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 ...

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

Original Poster
Rep: Reputation: 0
Thanks

Thanks Mara and MartinN It worked Thanks a lot

Best Regards

Morgan

 
  


Reply



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 05:56 PM
Formatting Linux HDD alex101 Mandriva 1 04-25-2004 11:02 AM
Formatting a Laptop HDD Haggy Linux - Laptop and Netbook 2 01-01-2004 02:02 AM
Help for formatting external hdd !! sudhir Linux - Hardware 4 12-11-2003 11:30 PM
formatting HDD mrengc Linux - Newbie 1 01-10-2003 01:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:36 AM.

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