-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpartitioning.shtml
More file actions
187 lines (151 loc) · 5.75 KB
/
partitioning.shtml
File metadata and controls
187 lines (151 loc) · 5.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
<!--#include file="include/iplHeader.html"-->
<h1>Linux on iPod - Partitioning</h1>
<p>The iPods are partitioned as either Win-iPods or Mac-iPods, the difference being that the Win versions use a FAT32 partition and the Mac versions HFS+ to store the music. From a technical perspective the two versions look something like:
<pre>
[FAT32]
hda1 Firmware partition
hda2 Music partition (FAT32)
[HFS+]
hda1 Partition map
hda2 Firmware partition
hda3 Music partition (HFS+)
</pre>
<p>In order to run Linux on your iPod you need a suitable root partition where the Linux operating system (not the kernel) can be stored. There are basically two possibilities either use use the Music partition, or create a new partition specifically for Linux.
<p>For Win-iPods if you use the music partition you will be using the UMSDOS filesystem for the root partition. This works fine under 2.4 but it looks like it won't be in 2.6. Furthermore, the standard kernel configuration (and the binary releases) don't have UMSDOS support and expect the root filesystem to be on hda3 so repartitioning is required to use that version.
<p>For Mac-iPods the HFS+ partition wlil work fine as a root partition so no repartition is required.
<p>If however you want a native Linux partition to use with uClinux the rest of this document shows you how!
<h2>Re-partitioning the iPod</h2>
<p><b>Please be aware, this has not been widely tested. Please don't skip the backup steps. Feedback on this process would be greatly appreciated!</b>
<p><b>This process is currently for Win-iPods. If someone tries this with a Mac-iPod please let me know the changes required!</b>
<p>In this process we will split the existing firmware partition into two partitions, the first will contain the firmware as it is now, the second will be our new root partition. This process will resize the firmware partition to 8MB and create a new 32MB EXT3 partition.
<p>The text in <b>bold</b> is typed in.
<ol>
<li>Plug in your iPod but don't mount it. It should show up as /dev/sda. E.g. for a 3g iPod;
<blockquote>
<code>
# <b>fdisk -l /dev/sda</b><br>
<pre>
Disk /dev/sda: 20.0 GB, 20000268288 bytes
255 heads, 63 sectors/track, 2431 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 5 40131 0 Empty
/dev/sda2 * 6 2431 19486845 b Win95 FAT32
</pre>
</code>
</blockquote>
<li>Backup the MBR (Mast Boot Record).
<blockquote>
<code>
# <b>dd if=/dev/sda of=mbr.backup bs=512 count=1</b>
</code>
</blockquote>
<li>Backup the firmware partition, replace x with something meaningful.
<blockquote>
<code>
# <b>dd if=/dev/sda1 of=firmware_x.backup</b>
</code>
</blockquote>
<li>Start fdisk.
<blockquote>
<code>
# <b>fdisk /dev/sda</b><br>
The number of cylinders for this disk is set to 2431.<br>
There is nothing wrong with that, but this is larger than 1024,<br>
and could in certain setups cause problems with:<br>
1) software that runs at boot time (e.g., old versions of LILO)<br>
2) booting and partitioning software from other OSs<br>
(e.g., DOS FDISK, OS/2 FDISK)<br>
<br>
Command (m for help):
</code>
</blockquote>
<li>Delete the firmware partition.
<blockquote>
<code>
Command (m for help): <b>d</b><br>
Partition number (1-4): <b>1</b>
</code>
</blockquote>
<li>Create a new primary partition with a length of 1 cylinder.
<blockquote>
<code>
Command (m for help): <b>n</b><br>
Command action<br>
e extended<br>
p primary partition (1-4)<br>
<b>p</b><br>
Partition number (1-4): <b>1</b><br>
First cylinder (1-2431, default 1): <b>1</b><br>
Last cylinder or +size or +sizeM or +sizeK (1-5, default 5): <b>1</b>
</code>
</blockquote>
<li>Activate the first partition.
<blockquote>
<code>
Command (m for help): <b>a</b><br>
Partition number (1-4): <b>1</b>
</code>
</blockquote>
<li>Set partition type to 'Empty'.
<blockquote>
<code>
Command (m for help): <b>t</b><br>
Partition number (1-4): <b>1</b><br>
Hex code (type L to list codes): <b>0</b>
</code>
</blockquote>
<li>Create the 3rd primary partition from 2nd to 5th Cylinder.
<blockquote>
<code>
Command (m for help): <b>n</b><br>
Command action<br>
e extended<br>
p primary partition (1-4)<br>
<b>p</b><br>
Partition number (1-4): <b>3</b><br>
First cylinder (1-2431, default 1): <b>2</b><br>
Last cylinder or +size or +sizeM or +sizeK (1-5, default 5): <b>5</b>
</code>
</blockquote>
<li>Review the changes. Note, this is for a 20GB verison, the sda2 partition size will vary.
<blockquote>
<code>
Command (m for help): <b>p</b><br>
<pre>
Disk /dev/sda: 20.0 GB, 20000268288 bytes
255 heads, 63 sectors/track, 2431 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1 8001 0 Empty
/dev/sda2 * 6 2431 19486845 b Win95 FAT32
/dev/sda3 2 5 32130 83 Linux
Partition table entries are not in disk order
</pre>
</code>
</blockquote>
<li>If everything looks ok, write out the partition table.
<blockquote>
<code>
Command (m for help): <b>w</b>
</code>
</blockquote>
<li>fdisk will now exit and we can create the new filesystem.
<blockquote>
<code>
# <b>mke2fs -j /dev/sda3</b>
</code>
</blockquote>
<li>Optionally, you may like to set the maximal mount count to never.
<blockquote>
<code>
# <b>tune2fs -c 0 /dev/sda3</b><br>
tune2fs 1.34 (25-Jul-2003)<br>
Setting maximal mount count to -1
</code>
</blockquote>
<li>Install the root filesystem to /dev/sda3 and the kernel to /dev/sda1.
</ol>
<h2>Acknowledgements</h2>
<p>This document is based on the fine work by Daniel Palffy!
<!--#include file="include/iplFooter.html"-->