LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell This Forum is for the discussion of Suse Linux.

Notices

Reply
 
Search this Thread
Old 07-10-2005, 01:53 AM   #1
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Rep: Reputation: 15
How to mount extended partitions


Here's what I'm trying to do.

I have a dual-boot system up and running with SuSE and xp .

The idea here is to learn to use linux but to have xp for the moment being while I find the right applications in Linux that will do the tasks I used to do in XP.

Unfortunately, because I'm a newbie I thought about 5 gigs would be enough for linux. Now I realize that's not the case.

There's like 5 gigs of free space on my HD.

I have 4 primary partitions, which means I can't create another partition.

I'm going to erase one partition with PartitionMagic and create two extended partitions:

-One partition will be FAT about 1 gig so xp and Linux can share data.
-second partition will have space allocated but I won't format it, I might format it FAT if I have to since I'm not an expert with partitionMagic.


QUESTION: Does anyone know if I'll be able to access the second extended partition with linux and how I can mount it or make it available to my linux box??

My SuSE setup has only 1 partition with everything stored in "/".
 
Old 07-10-2005, 03:24 AM   #2
Thoreau
Senior Member
 
Registered: May 2003
Location: /var/log/cabin
Distribution: All
Posts: 1,167

Rep: Reputation: 45
If your partition is fat16/32, you will be able to read/write to it. If your partition is NTFS 5/5.1 you will be able to read only. Both will be automounted on install/boot. Check the /media directory.
 
Old 07-10-2005, 05:26 AM   #3
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
Didn't you say you won't format your second logical partition? Then you can't access it. The other (FAT) partition can be mounted through an entry in /etc/fstab, e.g.:
Code:
/dev/hda5     /windows/D     vfat     defaults,umask=000 0 0
or manually, using the mount command (see 'man mount').
 
Old 07-10-2005, 06:37 AM   #4
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Original Poster
Rep: Reputation: 15
-------------------------------
Didn't you say you won't format your second logical partition?
------------------------------

I won't format it because I want to "add" it to my SUSE linux partition and have linux format it.

With Partition Magic I can make the FAT and NTFS partitions smaller and even grab unused space and add it to my windoze partitions.

That's exactly what I want to do except I want to add unused space to my linux partition. I don't know if I can do that with partition magic and I don't think if I would want to do that and don't know the best choice.

I suppose I could create an extended partition and just mount it somewhere.

Does anyone know of a way where I can "add" unused HD space to my linux partition???

Or maybe I should just create a new partition and mount it somewhere??
 
Old 07-10-2005, 07:44 AM   #5
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
Your thread title was a little confusing (howto mount...), so I didn't realize what you really wanted, sorry.

Resizing of NTFS partitions under Linux is not problem (you don't need Partition Magic). The easiest way would be to use the YaST interface to parted (System -> Partitioner). You simply click the partition and 'Resize'. However you should defragment the partition prior to resizing. This can only be done from Windows. And the partition is not supposed to be mounted, so unmount first. For resizing your Linux root partition, you will need a CD based Linux system, from which you can boot (e.g. SUSE Live CD or KNOPPIX). This is because you can't unmount your root partition while the system is running.

To add the space to another partition, they have to be adjacent to each other. Once you have empty space on either end of your linux partition, you can extend it into that space. If one is primary and the other logical, it might involve more steps (first you need to resize the extended partition into the empty space, then the logical partition). I know no 'software' solution to combine space (maybe some software RAID?) of other partitions.

Last edited by abisko00; 07-10-2005 at 07:46 AM.
 
Old 07-10-2005, 02:13 PM   #6
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Original Poster
Rep: Reputation: 15
-------------------------------------------------------------
To add the space to another partition, they have to be adjacent to each other. Once you have empty space on either end of your linux partition, you can extend it into that space
--------------------------------------------------------------

That's exactly what I'm trying to do!!!

Let's forget about NTFS here, I was just using that as an example!!

I have empty space in my HD and would like to add it to my existing SuSE Linux Box.

I have one partition for Linux with everything installed under "/". Right now I ran out of space and I'm trying to give Linux more space without having to reinstall Linux.

If you believe I can do it by going to (SYSTEM -> Partitioner) then I will try that and let you know if that one did it.

thanks!!!!!!
 
Old 07-10-2005, 03:43 PM   #7
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
Quote:
I have one partition for Linux with everything installed under "/".
Another option (maybe a little less risky than a resizing operation) would be to create a new Linux partion in the empty space and mount it as /home. This will free space on / and allow you to upgrade your system without putting your data in danger.
 
Old 07-10-2005, 05:10 PM   #8
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Original Poster
Rep: Reputation: 15
I tried going to SYSTEM -> Partitioner but unfortunately that utility can't see the free space!!

------------------------------------------------------------------------
Another option (maybe a little less risky than a resizing operation) would be to create a new Linux partion in the empty space and mount it as /home
------------------------------------------------------------------------
Right now, other than the appz I downloaded from the net and installed on my Linux box, I have no data.

My installation is quite new, about 3 weeks, and after tinkering with it and installing software I realized I would soon run out of space.

I can't even create music CD's!!! Forget about backing up a DVD...

Also, the space I want to create would be for new applications I want to install and whatever data the applications need.

I almost have no data.

I'm going to delete an NTFS partition with Partition magic and then create 2 extended partitions.

Or does anyone can think of a better solution??

Now to the original question!

How do I mount an extended partition to my linux box in my case?? My entire installation is under "/" and I only have one partition.
 
Old 07-11-2005, 02:58 AM   #9
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
Free space on an extenden partition cannot be added to a primary partition. Maybe you can post the output of fdisk -l here, which will give us information about your partition structure.

Quote:
How do I mount an extended partition to my linux box in my case??
Before I write again something you didn't ask: what do you mean by 'mount? 'Mount' describes the process of integrating an existing filesystem into the Linux tree. So if you have a formated partition, you can mount it to, let's say /mydata, and you can use the space on this partition under /mydata. You can also mount the new partition to /usr, which contains a lot of software. Anyway this will relax you space situation.

So back to your original question: if you have 4 primary partitions and you want to add space to your Linux partition, delete one of the partitions next to your Linux partition and extend the Linux filesystem into that empty space.

How would I do this? First, I would boot from a LiveCD, I prefer KNOPPIX. Next, I would open a root shell and start my favourite command-line partitioner 'cfdisk'. Now, I would delete both, the Linux and the next NTFS partition (don't worry, the data is not yet affected). Then I would create a new Linux partition that covers the whole space (I think it is best if the NTFS partition was at the lower end), save the new partition table and use the tool 'resize_reiserfs' to grow the filesystem to cover all space on the new partition.

See 'man resize_reiserfs' for details.

Last edited by abisko00; 07-11-2005 at 07:25 AM.
 
Old 07-11-2005, 07:42 AM   #10
John_Emad
Member
 
Registered: Dec 2004
Posts: 196

Rep: Reputation: 30
abisko00,

would you explain more this part ??


Free space on an extenden partition cannot be added to a primary partition. Maybe you can post the output of fdisk -l here, which will give us information about your partition structure.


I reduced the size of the home partition, but the root partition didnt see that free space so that I can add it

here is my fdisk -l output

Disk /dev/hda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 3458 27776353+ c W95 FAT32 (LBA)
/dev/hda2 3459 4864 11293695 f W95 Ext'd (LBA)
/dev/hda5 3459 3524 530113+ 82 Linux swap / Solaris
/dev/hda6 3525 4032 4080478+ 83 Linux
/dev/hda7 4033 4851 6576641 83 Linux


so, any advices ??

thanx in advance
 
Old 07-11-2005, 08:26 AM   #11
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
"Free space on an extended partition cannot be added to a primary partition."
What I wanted to say is that even if you have free space on your extended partition (e.g. if you delete swap in your case), you cannot add this space to the primary partition next to it without shrinking the surrounding extended partition.

But your case is different:

You have some free space at the end of your HDD (blocks 4851-4864), but not a lot. This space cannot be added to hda6, because it is not adjacent. So to shift space from hda7 to hda6, it has to be cut-off at the start of hda6. This may be more dangerous, if possible at all. I suggest to backup your data on hda7, delete the partition, enlarge hda6 and create a new hda7 later.

EDIT: If hda7 is your root partition, you should consider to outsource part of your filesystem on a new partition (e.g. /var or /opt). The only other option (to my knowledge) would be a fresh installation.

Last edited by abisko00; 07-11-2005 at 08:31 AM.
 
Old 07-11-2005, 08:46 AM   #12
John_Emad
Member
 
Registered: Dec 2004
Posts: 196

Rep: Reputation: 30
actually hda7 is my home partition not my root partition so I guess i can delete it easily

so, all I am gonna do is boot from CD1 then go to the Partitionner and then delete hda7 and then I will find hda6 possible to be enlarged ??

if yes, then what is the difference I made by this action than decreasing the space of hda7 and trying to take the empty part to hda6 ??

anyways if the solution is to delete hda7 and then hda6 can be enlarged then I find no problem with that, I can do it, I will wait for you reply

another question, after deleting hda7, I will have no home partition, so can I create it again from the partitioner after setting hda6 with the space I want ??

also can any data be deleted from hda6 this way ??

thanx alot for your efforts
 
Old 07-11-2005, 09:13 AM   #13
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,511

Rep: Reputation: 58
Quote:
if yes, then what is the difference I made by this action than decreasing the space of hda7 and trying to take the empty part to hda6 ??
I think it is because important information is stored at the beginning of a partition. For this reason, only the lower part is variable. However I am not sure about this! It may be different with different filesystems (I only resized reiserfs so far). Have a look at the manpage of your resizer.
Quote:
another question, after deleting hda7, I will have no home partition, so can I create it again from the partitioner after setting hda6 with the space I want ??
Yes! And you should do this before you reboot your system. Otherwise a new /home will be created on your root filesystem and you won't gain a lot.
Quote:
also can any data be deleted from hda6 this way ??
Resizing is always a dangerous operation! Backup, if possible! Be aware of what you are doing and don't panic!
 
Old 07-12-2005, 02:27 PM   #14
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Original Poster
Rep: Reputation: 15
----------------------------------------------
"Free space on an extended partition cannot be added to a primary partition."
---------------------------------------------

Obviously, I lost a lot of people here, my apologies.

Here is the entire story:

I originally had XP installed in my entire drive with a lot of mp3z and movies in my HD, mainly mp3z.

I wanted to give SuSE Linux a try so I reinstalled XP into its own partition(FAT) and created 2 NTFS partitions to hold data.

I had about 20 gigs left for linux and when I created the installation I only took up 5 gigs of space for SuSE because I thought that was enough and wanted to create another partition(FAT) to share data between linux and windoze.

This set up left about 15 or 10 gigs available of unused free space in the hard disk.

However, since I made a lot of progress in Linux I soon realize those 5 gigs would not be enough. Also, I could not create another partition since I already have 5 primary partitions and I could not create the partition to share data between Linux and windoze.

So there is my dilemma, I have free space in my Hard Disk but dont know how to add it to my Linux Partition! LOL

That's OK, I'll figure it out, I think. From what I have read in the newsgroup, the catch here is that in order for me to "add" space into my existing linux partition it needs to be right next to it. OK, I will have to get back on you on that since I haven't had a chance to work on my laptop since they just changed me to the night shift.

------------------------------------------------
You can also mount the new partition to /usr, which contains a lot of software. Anyway this will relax you space situation.
----------------------------------------------

I think if I create a new partition and then use the partitioning tool in linux I should be able to format the new partition and then mount it to "/usr".

Thanks, I'm finallly making some progress over here.

When I get my claws on my laptop and some time to work on it I'll let you know what I did.
 
Old 07-13-2005, 07:53 PM   #15
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Original Poster
Rep: Reputation: 15
------------------------
I would boot from a LiveCD, I prefer KNOPPIX. Next, I would open a root shell and start my favourite command-line partitioner 'cfdisk'.
-----------------------

Sounda kinda complicated. Have I've told you I'm a newbie? LOL

Hey, I am now able to see the free disk space and I don't really need to create any partitions to add the existing available space in my HD because it's right next to my linux partition.

Unfortunately, when I tried to add the unused free space on my HD to my linux partitions I got the following error:


The partition is currently mounted on /.
It is not possible to resize the file system while it is mounted.

Umount the file system and retry resizing.


I think maybe I will have to boot from a CD and then add the existing space to my linux partition using a utility??

Anyone with any experience doing this??

How would I go about creating a bootable CD (I dont have an "A" drive) and which utility do you recommend for me to add the existing unused space to my Linux partition??
 
  


Reply


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
fstab extended partitions Chrax Slackware 2 01-03-2005 06:19 PM
What can extended partitions be used for? imemyself Linux - Hardware 4 02-29-2004 06:55 PM
Debian Extended Partitions FlyingMoose Linux - Distributions 2 03-22-2003 03:05 PM
Can I mount extended XP partitions? Mystakill Linux - Newbie 3 05-16-2002 09:27 PM
Primary and Extended Partitions batman Linux - Software 1 10-18-2000 01:17 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration