| Linux - Kernel This forum is for all discussion relating to the Linux kernel. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-28-2011, 11:22 PM
|
#1
|
|
LQ Newbie
Registered: Aug 2010
Posts: 5
Rep:
|
How to map partitions to a specific device
Hi everyone,
I have a filesytem with 4 primary partitions already:
Device Boot Start End Blocks Id System
/dev/hda1 1 2 15655 83 Linux
/dev/hda2 3 4 15686 83 Linux
/dev/hda3 5 512 3984244 83 Linux
/dev/hda4 513 1020 3984244 83 Linux
I need to split the /dev/hda4 partition into two partitions without affecting partitions 1-3. I know that I have reached the maximum primary partitions already. So, I decided to delete /dev/hda4, and create an extended partition, and the add two logical partitions inside. Here is how it looks:
Device Boot Start End Blocks Id System
/dev/hda1 1 2 15655 83 Linux
/dev/hda2 3 4 15686 83 Linux
/dev/hda3 5 512 3984244 83 Linux
/dev/hda4 513 1020 3984244 5 Extended
/dev/hda5 513 960 3513633 83 Linux
/dev/hda6 961 1020 470549 83 Linux
Here is my problem... I need the partition mapped to /dev/hda5 to be mapped to /dev/hda4 instead. Does anyone know how or what tool to use to create partitions and specify device to map it to? Basically, I need the new partitions to be mapped like the following, without affecting the first 3 partitions:
Device Boot Start End Blocks Id System
/dev/hda1 1 2 15655 83 Linux
/dev/hda2 3 4 15686 83 Linux
/dev/hda3 5 512 3984244 83 Linux
/dev/hda5 513 1020 3984244 5 Extended
/dev/hda4 513 960 3513633 83 Linux
/dev/hda6 961 1020 470549 83 Linux
Any ideas as how to do this? Is that event possible?
Thanks for any help.
|
|
|
|
01-28-2011, 11:32 PM
|
#2
|
|
Member
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372
Rep: 
|
Can't be done.
An extended partition is sometimes called a "primary extended partition".
Partitions 1-4, the primary partitions, actually are mapped by four "slots" or structures in the Master boot record. Any one of them can be set up to be an extended partition.
Within an extended partition the logical partitions are numbered starting at 5 and nowadays can only go to 15. (They once could theoretically go to 63.) The logicals are all chained together and their position in the chain determines what the partition number is.
Out of curiosity, why do you need to do what you are asking about?
Last edited by tommylovell; 01-28-2011 at 11:37 PM.
|
|
|
|
01-28-2011, 11:41 PM
|
#3
|
|
LQ Newbie
Registered: Aug 2010
Posts: 5
Original Poster
Rep:
|
This is an embedded system, and the older software running on the machine only knows about hda3 and hda4 partitions. I'm trying to change it to create partitions for swap and logs, without breaking the old software. The new software uses cmdline to figure partitions, but the old one was hardcoded.
Thanks for your quick reply. It helps me to make a quick decision.
cheers.
|
|
|
|
01-28-2011, 11:45 PM
|
#4
|
|
Member
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372
Rep: 
|
Ouch. Sorry I couldn't give you better news.
|
|
|
|
02-18-2011, 09:40 PM
|
#5
|
|
Member
Registered: Feb 2011
Distribution: Ubuntu, Debian(ARM),XP,W7,CP/M
Posts: 117
Rep:
|
This may be newbie-ignorance,
(and I apologize for reopening a 'solved' thread)
but...
Would it not be possible to change the /dev settings?
such as (numbers used for example ONLY)
(are actually /dev/sd*)
/dev/hda1 b 8 1
/dev/hda2 b 8 2
/dev/hdb1 b 16 1
/dev/hdb2 b 16 2
changed to
/dev/hda1 b 8 1
/dev/hda2 b 16 1
/dev/hdb1 b 8 2
/dev/hdb2 b 16 2
and that, I think, would access the partitions 'correctly'?
as I said, wild-azz guess here.

Last edited by justboo2u; 02-18-2011 at 10:09 PM.
|
|
|
|
02-19-2011, 12:33 PM
|
#6
|
|
Member
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372
Rep: 
|
You'd be better off posting that question as a new thread.
You need to mention that your system is an embedded system. What distro it is based on. Whether is has a monolithic kernel or modular kernel. Whether it uses an initial ramdisk. How initialization is done. Whether it uses UDEV. Etc.
Things that are well beyond my expertise.
And posting it under "Linux - Embedded" might be the most appropriate place for it.
I have a tendency to think that it can be done, but it might be extremely difficult and lead to a system that is difficult to understand.
|
|
|
|
02-19-2011, 08:18 PM
|
#7
|
|
Member
Registered: Feb 2011
Distribution: Ubuntu, Debian(ARM),XP,W7,CP/M
Posts: 117
Rep:
|
Quote:
Originally Posted by tommylovell
You'd be better off posting that question as a new thread.
You need to mention that your system is an embedded system. What distro it is based on. Whether is has a monolithic kernel or modular kernel. Whether it uses an initial ramdisk. How initialization is done. Whether it uses UDEV. Etc.
Things that are well beyond my expertise.
And posting it under "Linux - Embedded" might be the most appropriate place for it.
I have a tendency to think that it can be done, but it might be extremely difficult and lead to a system that is difficult to understand.
|
(Presuming you were directing this toward me...)
I was not posting a question... more of a question-based answer.
Thus, no details.

Last edited by justboo2u; 02-19-2011 at 08:19 PM.
|
|
|
|
02-20-2011, 10:04 AM
|
#8
|
|
Member
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372
Rep: 
|
oops. sorry. I didn't look closely enough and just assumed you were the original poster.
your suggestion to the OP has some potential. it might be easy to do, but is way beyond me.
|
|
|
|
02-20-2011, 03:39 PM
|
#9
|
|
Member
Registered: Feb 2011
Distribution: Ubuntu, Debian(ARM),XP,W7,CP/M
Posts: 117
Rep:
|
Quote:
Originally Posted by tommylovell
oops. sorry. I didn't look closely enough and just assumed you were the original poster.
your suggestion to the OP has some potential. it might be easy to do, but is way beyond me.
|
Not really that difficult...
document the info for the 2 devices:
/dev/hda4 b x1 y1
/dev/hda5 b x2 y2
UNMOUNT THE PARTITIONS if they are mounted (likely hda5 only)
then rm /dev/hda4 /dev/hda5
then mknod /dev/hda4 b x2 y2
and. mknod /dev/hda5 b x1 y1
then he should be able to mount /dev/hda4 and have it be the proper filesystem...

|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:21 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|