Difference between revisions of "Custom Partitions on the LS Pro"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
(How to enable telnet in EM Mode)
(Fixed the forum link, Repartitioning LS-PRO)
 
(42 intermediate revisions by 19 users not shown)
Line 1: Line 1:
 +
{{Articles|LSPro}}
 
== How to get into EM Mode ==
 
== How to get into EM Mode ==
  
The LS pro has a mechanism built in to revert back to EM Mode if the box wasn`t able to boot three times in a row.<br>
+
Note that in the stock 1.03 firmware, you can enable telnet '''without''' going into EM mode. See [[Custom_Partitions_on_the_LS_Pro#How_to_enable_telnet_in_EM_Mode|How to enable telnet in EM Mode]], below for details.
 +
 
 +
== !WARNING! - THESE INSTRUCTIONS MAY NOT BE ACCURATE.  SEE:[http://forum.buffalo.nas-central.org/viewtopic.php?p=26122#p26122 [Repartitioning LS-PRO]] ==
 +
 
 +
 
 +
The LS pro has a mechanism built in to revert back to [[EM_Mode|EM Mode]] if the box wasn`t able to boot three times in a row.<br>
 
Now we want to use this to force the box into EM Mode<br>
 
Now we want to use this to force the box into EM Mode<br>
 
<br>
 
<br>
 
=== Do this 3 times ===
 
=== Do this 3 times ===
1) Turn on your LS pro and hear the first sound.<br>
+
'''1)''' Turn on your LS pro and hear the first sound.<br><br>
2) The second sound is played after about 20 seconds.<br>
+
'''2a)''' Stock initrd<br>
3) Press the power button as long as it takes so the LS pro turns off.<br>
+
You will hear no second sound. Just go to 3 after 20 - 23 seconds<br><br>
 +
'''2b)''' lb_worm`s enhanced initrd (bundled with freelink/custom firmwares)<br>
 +
The second sound is played after about 20 - 23 seconds.<br><br>
 +
'''3)''' Press the power button as long as it takes so the LS pro turns off.<br>
 
<br>
 
<br>
== How to enable telnet in EM Mode ==
+
See also [[EM_Mode|EM Mode]] how to exit EM Mode.
 +
 
 +
== How to enable telnet w/ ACP Commander (both hddrootfs in EM Mode) ==
  
 
possibly if you use a newer ramdisk then telnet might run by default...then there is no need for using acp_commander.<br>
 
possibly if you use a newer ramdisk then telnet might run by default...then there is no need for using acp_commander.<br>
 
<br>
 
<br>
1) download http://downloads.linkstationwiki.net/uploads/LS_Pro_temporary/LSCustomUpdater/acp_commander.jar<br>
+
# download [http://downloads.nas-central.org/TOOLS/ALL_LS_KB_ARM9/ACP_COMMANDER/acp_commander.jar ACP Commander]<br>
2) change to the commandline (regardless if linux or windows) and execute the jar file with<br>
+
# Stop the firewall
  java -jar acp_commander -t <linkstation-ip> -o
+
# change to the commandline (regardless if linux or windows) and execute the jar file with<br>
 +
  java -jar acp_commander.jar -t <linkstation-ip> -o
  
 
you should see something like this:<br>
 
you should see something like this:<br>
  
 
   java -jar acp_commander.jar -t 192.168.1.11 -o
 
   java -jar acp_commander.jar -t 192.168.1.11 -o
   ACP_commander out of the linkstationwiki.net project.  
+
   ACP_commander out of the nas-central.org project.  
 
   Used to send ACP-commands to Buffalo linkstation(R) LS-PRO.
 
   Used to send ACP-commands to Buffalo linkstation(R) LS-PRO.
  
Line 38: Line 50:
 
the LS Pro should respond to 192.168.11.150<br>
 
the LS Pro should respond to 192.168.11.150<br>
 
<br>
 
<br>
1) execute<br>
+
'''1)''' execute<br>
 
   telnet <linkstation-ip>
 
   telnet <linkstation-ip>
2) and login with "root"<br>
+
'''2)''' and login with "root"<br>
 
no password should be asked.<br>
 
no password should be asked.<br>
 
<br>
 
<br>
 
== Partition Table before modification ==
 
== Partition Table before modification ==
  
1) use fdisk to partition /dev/sda, start with that and then look at the partitiontable by hitting "p" + enter
+
'''1)''' use fdisk to partition /dev/sda, start with that and then look at the partitiontable by hitting "p" + enter
 
   fdisk /dev/sda
 
   fdisk /dev/sda
  
Line 61: Line 73:
 
   /dev/sda6            105      30401  243360621  83  Linux
 
   /dev/sda6            105      30401  243360621  83  Linux
  
2) if you hit "m" you see a help. <br>
+
'''Note:''' At least the V2 Linkstation Live (possibly all V2 devices) has a larger /boot partition (/dev/sda1):
 +
 
 +
Disk /dev/sda: 500.1 GB, 500107862016 bytes
 +
255 heads, 63 sectors/track, 60801 cylinders
 +
Units = cylinders of 16065 * 512 = 8225280 bytes
 +
 
 +
 
 +
    Device Boot      Start        End      Blocks  Id  System
 +
/dev/sda1              1          37      297171  83  Linux
 +
/dev/sda2              38          99      498015  83  Linux
 +
/dev/sda4            100      60801  487588815  5  Extended
 +
/dev/sda5            100        116      136521  82  Linux swap
 +
/dev/sda6            117      60784  487315678+  83  Linux
 +
 
 +
 
 +
'''2)''' if you hit "m" you see a help. <br>
  
  
 
so basically we want to have a bigger /dev/sda2 (/dev/sda4 + /dev/sda6 need to be smaller).<br>
 
so basically we want to have a bigger /dev/sda2 (/dev/sda4 + /dev/sda6 need to be smaller).<br>
this means we have to delete the complete partition table first.<br>
+
this means we first have to delete all partitions except for /dev/sda1.<br>
 
<br>
 
<br>
  
 
== HowTo setup the internal HDD ==
 
== HowTo setup the internal HDD ==
  
=== Delete all partitions ===
+
Before you are going on and just do it the way it is posted here you should read
 +
* [[Custom_Partitions_on_the_LS_Pro#What_are_these_partitions_for.3F|What are these partitions for?]]
 +
* [[Custom_Partitions_on_the_LS_Pro#Even_more_partitions.2C_to_ease_your_life|Even more partitions, to ease your life]] (this is quite important)
 +
 
 +
 
 +
=== Delete all partitions except /dev/sda1 ===
 +
 
 +
'''warning''' if you delete all the partitions the box won't reboot anymore, you can destroy all the partitions except /dev/sda1
  
 
  sh-2.05b# fdisk /dev/sda
 
  sh-2.05b# fdisk /dev/sda
Line 80: Line 114:
 
  2) booting and partitioning software from other OS
 
  2) booting and partitioning software from other OS
 
  (e.g., DOS FDISK, OS/2 FDISK)
 
  (e.g., DOS FDISK, OS/2 FDISK)
 
Command (m for help): '''d'''
 
Partition number (1-6): '''1'''
 
  
 
  Command (m for help): '''d'''
 
  Command (m for help): '''d'''
Line 89: Line 120:
 
  Command (m for help): '''d'''
 
  Command (m for help): '''d'''
 
  Partition number (1-6): '''4'''
 
  Partition number (1-6): '''4'''
 
Command (m for help): '''d'''
 
No partition is defined yet!
 
  
 
  Command (m for help): '''p'''
 
  Command (m for help): '''p'''
Line 99: Line 127:
 
  Units = cylinders of 16065 * 512 = 8225280 bytes
 
  Units = cylinders of 16065 * 512 = 8225280 bytes
  
  Device Boot      Start        End      Blocks  Id  System
+
  Device Boot      Start        End      Blocks  Id  System
 +
/dev/sda1              1          25      200781  83  Linux
  
 
=== Create the custom partitions ===
 
=== Create the custom partitions ===
 
Command (m for help): '''n'''
 
Command action
 
    e  extended
 
    p  primary partition (1-4)
 
'''p'''
 
Partition number (1-4): '''1'''
 
First cylinder (1-30401, default 1): '''1'''
 
Last cylinder or +size or +sizeM or +sizeK (1-30401, default 30401): '''+300M'''
 
  
 
  Command (m for help): '''n'''
 
  Command (m for help): '''n'''
Line 118: Line 138:
 
  '''p'''
 
  '''p'''
 
  Partition number (1-4): '''2'''
 
  Partition number (1-4): '''2'''
  First cylinder (38-30401, default 38): '''<enter>'''
+
  First cylinder (26-30401, default 26): '''<enter>'''
  Using default value 38
+
  Using default value 26
  Last cylinder or +size or +sizeM or +sizeK (38-30401, default 30401): '''+3000M'''
+
  Last cylinder or +size or +sizeM or +sizeK (26-30401, default 30401): '''+3000M'''
  
 
  Command (m for help): '''n'''
 
  Command (m for help): '''n'''
Line 128: Line 148:
 
  '''e'''
 
  '''e'''
 
  Partition number (1-4): '''4'''
 
  Partition number (1-4): '''4'''
  First cylinder (404-30401, default 404): '''<enter>'''
+
  First cylinder (392-30401, default 392): '''<enter>'''
  Using default value 404
+
  Using default value 392
  Last cylinder or +size or +sizeM or +sizeK (404-30401, default 30401):'''<enter>'''
+
  Last cylinder or +size or +sizeM or +sizeK (392-30401, default 30401):'''<enter>'''
 
  Using default value 30401
 
  Using default value 30401
  
Line 140: Line 160:
  
 
   Device Boot      Start        End      Blocks  Id  System
 
   Device Boot      Start        End      Blocks  Id  System
  /dev/sda1              1          37     297171   83  Linux
+
  /dev/sda1              1          25     200781   83  Linux
  /dev/sda2              38         403     2939895  83  Linux
+
  /dev/sda2              26         391     2939895  83  Linux
  /dev/sda4            404       30401  240958935   5  Extended
+
  /dev/sda4            392       30401  241055325   5  Extended
  
  
Line 184: Line 204:
  
 
   Device Boot      Start        End      Blocks  Id  System
 
   Device Boot      Start        End      Blocks  Id  System
  /dev/sda1              1          37     297171   83  Linux
+
  /dev/sda1              1          25     200781   83  Linux
  /dev/sda2              38         403     2939895  83  Linux
+
  /dev/sda2              26         391     2939895  83  Linux
  /dev/sda4            404       30401  240958935   f  W95 Ext'd (LBA)
+
  /dev/sda4            392       30401  241055325   f  W95 Ext'd (LBA)
  
==== Creating logical partitions for swap + data ====
+
==== Creating logical partitions for swap + data ====
  
 
  Command (m for help): '''n'''
 
  Command (m for help): '''n'''
Line 195: Line 215:
 
     p  primary partition (1-4)
 
     p  primary partition (1-4)
 
  '''l'''
 
  '''l'''
  First cylinder (404-30401, default 404): '''<enter>'''
+
  First cylinder (392-30401, default 392): '''<enter>'''
  Using default value 404
+
  Using default value 392
  Last cylinder or +size or +sizeM or +sizeK (404-30401, default 30401): '''+300M'''     
+
  Last cylinder or +size or +sizeM or +sizeK (392-30401, default 30401): '''+300M'''     
 
  Command (m for help): '''n'''
 
  Command (m for help): '''n'''
 
  Command action
 
  Command action
Line 203: Line 223:
 
   p  primary partition (1-4)
 
   p  primary partition (1-4)
 
  '''l'''
 
  '''l'''
  First cylinder (441-30401, default 441): '''<enter>'''
+
  First cylinder (429-30401, default 429): '''<enter>'''
  Using default value 441
+
  Using default value 429
  Last cylinder or +size or +sizeM or +sizeK (441-30401, default 30401): '''<enter>'''
+
  Last cylinder or +size or +sizeM or +sizeK (429-30401, default 30401): '''<enter>'''
 
  Using default value 30401
 
  Using default value 30401
  
Line 215: Line 235:
  
 
   Device Boot      Start        End      Blocks  Id  System
 
   Device Boot      Start        End      Blocks  Id  System
  /dev/sda1              1          37     297171   83  Linux
+
  /dev/sda1              1          25     200781   83  Linux
  /dev/sda2              38         403     2939895  83  Linux
+
  /dev/sda2              26         391     2939895  83  Linux
  /dev/sda4            404       30401  240958935   f  W95 Ext'd (LBA)
+
  /dev/sda4            392       30401  241055325   f  W95 Ext'd (LBA)
  /dev/sda5            404         440     297171  83  Linux
+
  /dev/sda5            392         428     297171  83  Linux
  /dev/sda6            441       30401  240661701   83  Linux
+
  /dev/sda6            429       30401  240758091   83  Linux
  
 
==== Change partition type of swap partition to swap ====
 
==== Change partition type of swap partition to swap ====
Line 260: Line 280:
  
 
     Device Boot      Start        End      Blocks  Id  System
 
     Device Boot      Start        End      Blocks  Id  System
  /dev/sda1              1          37     297171   83  Linux
+
  /dev/sda1              1          25     200781   83  Linux
  /dev/sda2              38         403     2939895  83  Linux
+
  /dev/sda2              26         391     2939895  83  Linux
  /dev/sda4            404       30401  240958935   f  W95 Ext'd (LBA)
+
  /dev/sda4            392       30401  241055325   f  W95 Ext'd (LBA)
  /dev/sda5            404         440     297171  82  Linux swap
+
  /dev/sda5            392         428     297171  82  Linux swap
  /dev/sda6            441       30401  240661701   83  Linux
+
  /dev/sda6            429       30401  240758091   83  Linux
  
 
==== Saving the new partition table to the hdd ====
 
==== Saving the new partition table to the hdd ====
Line 279: Line 299:
  
 
  sh-2.05b#'''reboot'''
 
  sh-2.05b#'''reboot'''
 +
 +
 +
 +
'''warning''' if you deleted all the partitions this reboot won't work. It will work only if you left /dev/sda1 untouched. You can destroy and resize all the other partitions.
  
 
== firmware-update ==
 
== firmware-update ==
Line 291: Line 315:
 
=== freelink ===
 
=== freelink ===
 
* use mkfs.ext2/mkfs.ext3/mkfs.xfs to create the filesystem on /dev/sda6
 
* use mkfs.ext2/mkfs.ext3/mkfs.xfs to create the filesystem on /dev/sda6
 +
* use mkswap to create the swap filesystem on /dev/sda5
 
* modify your /etc/fstab accordingly to the filesystem-type
 
* modify your /etc/fstab accordingly to the filesystem-type
  
Line 328: Line 353:
 
this is where all your shares + data is stored.<br>
 
this is where all your shares + data is stored.<br>
  
=== what is the best way to backup the data if you still have something important on your disk? ===
+
=== Even more partitions, to ease your life (sort of making the partition scheme future-proof) ===
 +
Those who need it may create additional partitions at the ''end'' of the large data partition '''/dev/sda6''', thus keeping the partitioning scheme as before up to this partition (might keep the firmware updater happy on future updates), and making the data saved on them persistent during future firmware or OS upgrades / changes, without having to backup everything.<br>
 +
Of course, they are optional, you can certainly do without them, it's just a proposal.
 +
Even better, if you just create them while you still can (no data yet on the big partition) and just mount them when the time comes, it's just good practice to be prepared...<br>
 +
<br>
 +
'''/dev/sda7:'''
 +
While some users install an alternative firmware on the LSpro, if they choose a full OS like Debian or Gentoo, they might even want to use the box as a home LAN server, maybe with centralized authentication (for Linux and Windows via Samba + OpenLDAP). In that case, it's common to have the '''/home''' in Linux and also the '''Windows user profiles''' mounted from the server. It is then very advisable to have a separate partition on the server for this, which will hold user settings, important documents for few users in a household. Big files would be off-loaded to the large data partition anyway. You should know how big you'd make this partition, according to your needs.<br>
 +
<br>
 +
'''/dev/sda8:'''
 +
An extra partition for OS-es like Gentoo, in which to hold the whole package database files, downloads and binaries built on the poor LSpro, which would only bloat the root files system, and also in order to have them ready to use after a major Gentoo re-installation.<br>
 +
Of course, if you don't create this partition, you can still use a symlink to a directory on your large data partition for this purpose. If you create it, well, a size of 3 to 4GB would be good, as you might want to export these directories to other Gentoo machines in your LAN, too. More info when the upcoming Genlink for LSpro is released.<br>
 +
 
 +
=== what is the best way to backup the data from EM if you still have something important on your disk? ===
  
 
this was the case for me..i wanted to rescue the folder where i had all my linkstation-related stuff...<br>
 
this was the case for me..i wanted to rescue the folder where i had all my linkstation-related stuff...<br>
Line 335: Line 372:
 
i only had a 1 GB USB-Stick, but this obviously also works with a big usbdisk.<br>
 
i only had a 1 GB USB-Stick, but this obviously also works with a big usbdisk.<br>
 
<br>
 
<br>
1) while in EM Mode connect your usbstick/hdd to the LS Pro<br>
+
'''1)''' while in EM Mode connect your usbstick/hdd to the LS Pro<br>
2) create a linux partition on the usbstick/hdd<br>
+
'''2)''' create a linux partition on the usbstick/hdd<br>
fdisk /dev/sdb<br>
+
'''fdisk /dev/sdb'''<br>
d<br>
+
'''d'''<br>
n<br>
+
'''n'''<br>
p<br>
+
'''p'''<br>
1<br>
+
'''1'''<br>
<enter><br>
+
'''<enter>'''<br>
<enter><br>
+
'''<enter>'''<br>
3) now you have a linux partition which covers the complete usb-disk/stick<br>
+
'''3)''' now you have a linux partition which covers the complete usb-disk/stick<br>
4) create an ext2 filesystem on the disk (FAT is NOT supported by the kernel while in the Ramdisk)<br>
+
'''4)''' create an ext2 filesystem on the disk (FAT is NOT supported by the kernel while in the Ramdisk)<br>
 
   mkfs.ext2 /dev/sdb1
 
   mkfs.ext2 /dev/sdb1
5) manually mount the usb-stick/disk to /mnt/usbdisk1<br>
+
'''5)''' manually mount the usb-stick/disk to /mnt/usbdisk1<br>
 
   mount /dev/sdb1 /mnt/usbdisk1
 
   mount /dev/sdb1 /mnt/usbdisk1
6) mount the data partition of the internal hdd to /mnt/disk1<br>
+
'''6)''' mount the data partition of the internal hdd to /mnt/disk1<br>
 
   mount /dev/sda6 /mnt/disk1
 
   mount /dev/sda6 /mnt/disk1
7) now you can copy all the things to the other disk with cp or mv<br>
+
'''7a)''' now you can copy all the things to the other disk with cp or mv<br>
 
  cp /mnt/disk1/<source> /mnt/usbdisk1/<target>
 
  cp /mnt/disk1/<source> /mnt/usbdisk1/<target>
  mv /mnt/disk1/<source> /mnt/usbdisk1/<target>
+
  mv /mnt/disk1/<source> /mnt/usbdisk1/<target><br>
<br>
+
 
you can use the -r switch for recursive as well.<br>
 
you can use the -r switch for recursive as well.<br>
br>
+
 
or use tar (this again is recursive):<br>
+
'''7b)''' or use tar (this again is recursive):<br>
  tar -czvf /mnt/usbdisk1/<target>.tar.gz /mnt/disk1/<source>
+
  tar -czvpf /mnt/usbdisk1/<target>.tar.gz /mnt/disk1/<source>
 +
 
 +
'''7c)''' or even use cpio and find; quick guide at: http://jeremy.zawodny.com/blog/archives/010037.html
 +
mkdir /mnt/usbdisk1/<target>
 +
cd /mnt/sda1
 +
find . -print | cpio -Bpdumv /mnt/usbdisk1/<target>
  
 
=== how do i read that linux usbhdd/usbstick i used for backup?===
 
=== how do i read that linux usbhdd/usbstick i used for backup?===
Line 366: Line 407:
 
(it isn`t able to compile on the LS pro currently)<br>
 
(it isn`t able to compile on the LS pro currently)<br>
 
<br>
 
<br>
'''Windows:''' www.fs-driver.org<br>
+
'''Windows:''' www.fs-driver.org or http://www.diskinternals.com/linux-reader/<br>
'''Linux:''' just mount the ext2-filesysytembr>
+
'''Linux:''' just mount the ext2-filesysytem

Latest revision as of 07:23, 9 March 2012

Contents

How to get into EM Mode

Note that in the stock 1.03 firmware, you can enable telnet without going into EM mode. See How to enable telnet in EM Mode, below for details.

 !WARNING! - THESE INSTRUCTIONS MAY NOT BE ACCURATE. SEE:[Repartitioning LS-PRO]

The LS pro has a mechanism built in to revert back to EM Mode if the box wasn`t able to boot three times in a row.
Now we want to use this to force the box into EM Mode

Do this 3 times

1) Turn on your LS pro and hear the first sound.

2a) Stock initrd
You will hear no second sound. Just go to 3 after 20 - 23 seconds

2b) lb_worm`s enhanced initrd (bundled with freelink/custom firmwares)
The second sound is played after about 20 - 23 seconds.

3) Press the power button as long as it takes so the LS pro turns off.

See also EM Mode how to exit EM Mode.

How to enable telnet w/ ACP Commander (both hddrootfs in EM Mode)

possibly if you use a newer ramdisk then telnet might run by default...then there is no need for using acp_commander.

  1. download ACP Commander
  2. Stop the firewall
  3. change to the commandline (regardless if linux or windows) and execute the jar file with
java -jar acp_commander.jar -t <linkstation-ip> -o

you should see something like this:

 java -jar acp_commander.jar -t 192.168.1.11 -o
 ACP_commander out of the nas-central.org project. 
 Used to send ACP-commands to Buffalo linkstation(R) LS-PRO.
 Using random connID value = FB6A7FCF57E6
 Using target:   192.168.1.11/192.168.1.11
 **no message**
 **no message**
 Password changed.

Now telnet is running and the root password is cleared in EM Mode. this change is non-persistent.
if you reboot your box now, telnet wouldn`t run. you would have to use acp_commander again.

How to login in EM Mode with telnet


if you use dhcp then your box might even use dhcp in EM Mode...mine does.
if you do not use dhcp you might have to change your static IP to one from the 192.168.11.x range.
the LS Pro should respond to 192.168.11.150

1) execute

 telnet <linkstation-ip>

2) and login with "root"
no password should be asked.

Partition Table before modification

1) use fdisk to partition /dev/sda, start with that and then look at the partitiontable by hitting "p" + enter

 fdisk /dev/sda
 Command (m for help): p
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
  Device Boot      Start         End      Blocks   Id  System
 /dev/sda1               1          25      200781   83  Linux
 /dev/sda2              26          87      498015   83  Linux
 /dev/sda4              88       30401   243497205    f  W95 Ext'd (LBA)
 /dev/sda5              88         104      136521   82  Linux swap
 /dev/sda6             105       30401   243360621   83  Linux

Note: At least the V2 Linkstation Live (possibly all V2 devices) has a larger /boot partition (/dev/sda1):

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


    Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          37      297171   83  Linux
/dev/sda2              38          99      498015   83  Linux
/dev/sda4             100       60801   487588815   5   Extended
/dev/sda5             100         116      136521   82  Linux swap
/dev/sda6             117       60784   487315678+  83  Linux


2) if you hit "m" you see a help.


so basically we want to have a bigger /dev/sda2 (/dev/sda4 + /dev/sda6 need to be smaller).
this means we first have to delete all partitions except for /dev/sda1.

HowTo setup the internal HDD

Before you are going on and just do it the way it is posted here you should read


Delete all partitions except /dev/sda1

warning if you delete all the partitions the box won't reboot anymore, you can destroy all the partitions except /dev/sda1

sh-2.05b# fdisk /dev/sda
The number of cylinders for this disk is set to 30401.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OS
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): d
Partition number (1-6): 2
Command (m for help): d
Partition number (1-6): 4
Command (m for help): p
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          25      200781   83  Linux

Create the custom partitions

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (26-30401, default 26): <enter>
Using default value 26
Last cylinder or +size or +sizeM or +sizeK (26-30401, default 30401): +3000M
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 4
First cylinder (392-30401, default 392): <enter>
Using default value 392
Last cylinder or +size or +sizeM or +sizeK (392-30401, default 30401):<enter>
Using default value 30401
Command (m for help): p
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
  Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          25      200781   83  Linux
/dev/sda2              26         391     2939895   83  Linux
/dev/sda4             392       30401   241055325    5  Extended


Change Partition Type of Extended Partition to W95 Ext'd (LBA)

Command (m for help): t
Partition number (1-5): 4
Hex code (type L to list codes): L
 0  Empty           1c  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid
 1  FAT12           1e  Hidden W95 FAT1 75  PC/IX           be  Solaris boot
 2  XENIX root      24  NEC DOS         80  Old Minix       c1  DRDOS/sec (FAT-
 3  XENIX usr       39  Plan 9          81  Minix / old Lin c4  DRDOS/sec (FAT-
 4  FAT16 <32M      3c  PartitionMagic  82  Linux swap      c6  DRDOS/sec (FAT-
 5  Extended        40  Venix 80286     83  Linux           c7  Syrinx
 6  FAT16           41  PPC PReP Boot   84  OS/2 hidden C:  da  Non-FS data
 7  HPFS/NTFS       42  SFS             85  Linux extended  db  CP/M / CTOS / .
 8  AIX             4d  QNX4.x          86  NTFS volume set de  Dell Utility
 9  AIX bootable    4e  QNX4.x 2nd part 87  NTFS volume set df  BootIt
 a  OS/2 Boot Manag 4f  QNX4.x 3rd part 8e  Linux LVM       e1  DOS access
 b  W95 FAT32       50  OnTrack DM      93  Amoeba          e3  DOS R/O
 c  W95 FAT32 (LBA) 51  OnTrack DM6 Aux 94  Amoeba BBT      e4  SpeedStor
 e  W95 FAT16 (LBA) 52  CP/M            9f  BSD/OS          eb  BeOS fs
 f  W95 Ext'd (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi ee  EFI GPT
10  OPUS            54  OnTrackDM6      a5  FreeBSD         ef  EFI (FAT-12/16/
11  Hidden FAT12    55  EZ-Drive        a6  OpenBSD         f0  Linux/PA-RISC b
12  Compaq diagnost 56  Golden Bow      a7  NeXTSTEP        f1  SpeedStor
14  Hidden FAT16 <3 5c  Priam Edisk     a8  Darwin UFS      f4  SpeedStor
16  Hidden FAT16    61  SpeedStor       a9  NetBSD          f2  DOS secondary
17  Hidden HPFS/NTF 63  GNU HURD or Sys ab  Darwin boot     fd  Linux raid auto
18  AST SmartSleep  64  Novell Netware  b7  BSDI fs         fe  LANstep
1b  Hidden W95 FAT3 65  Novell Netware  b8  BSDI swap       ff  BBT
Hex code (type L to list codes): f
Changed system type of partition 4 to f (W95 Ext'd (LBA))
Command (m for help): p
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
  Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          25      200781   83  Linux
/dev/sda2              26         391     2939895   83  Linux
/dev/sda4             392       30401   241055325    f  W95 Ext'd (LBA)

Creating logical partitions for swap + data

Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (392-30401, default 392): <enter>
Using default value 392
Last cylinder or +size or +sizeM or +sizeK (392-30401, default 30401): +300M    
Command (m for help): n
Command action
  l   logical (5 or over)
  p   primary partition (1-4)
l
First cylinder (429-30401, default 429): <enter>
Using default value 429
Last cylinder or +size or +sizeM or +sizeK (429-30401, default 30401): <enter>
Using default value 30401
Command (m for help): p 
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
  Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          25      200781   83  Linux
/dev/sda2              26         391     2939895   83  Linux
/dev/sda4             392       30401   241055325    f  W95 Ext'd (LBA)
/dev/sda5             392         428      297171   83  Linux
/dev/sda6             429       30401   240758091   83  Linux

Change partition type of swap partition to swap

Command (m for help): t
Partition number (1-6): 5
Hex code (type L to list codes): L
0  Empty           1c  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid
1  FAT12           1e  Hidden W95 FAT1 75  PC/IX           be  Solaris boot
2  XENIX root      24  NEC DOS         80  Old Minix       c1  DRDOS/sec (FAT-
3  XENIX usr       39  Plan 9          81  Minix / old Lin c4  DRDOS/sec (FAT-
4  FAT16 <32M      3c  PartitionMagic  82  Linux swap      c6  DRDOS/sec (FAT-
5  Extended        40  Venix 80286     83  Linux           c7  Syrinx
6  FAT16           41  PPC PReP Boot   84  OS/2 hidden C:  da  Non-FS data
7  HPFS/NTFS       42  SFS             85  Linux extended  db  CP/M / CTOS / .
8  AIX             4d  QNX4.x          86  NTFS volume set de  Dell Utility
9  AIX bootable    4e  QNX4.x 2nd part 87  NTFS volume set df  BootIt
a  OS/2 Boot Manag 4f  QNX4.x 3rd part 8e  Linux LVM       e1  DOS access
b  W95 FAT32       50  OnTrack DM      93  Amoeba          e3  DOS R/O
c  W95 FAT32 (LBA) 51  OnTrack DM6 Aux 94  Amoeba BBT      e4  SpeedStor
e  W95 FAT16 (LBA) 52  CP/M            9f  BSD/OS          eb  BeOS fs
f  W95 Ext'd (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi ee  EFI GPT
10  OPUS            54  OnTrackDM6      a5  FreeBSD         ef  EFI (FAT-12/16/
11  Hidden FAT12    55  EZ-Drive        a6  OpenBSD         f0  Linux/PA-RISC b
12  Compaq diagnost 56  Golden Bow      a7  NeXTSTEP        f1  SpeedStor
14  Hidden FAT16 <3 5c  Priam Edisk     a8  Darwin UFS      f4  SpeedStor
16  Hidden FAT16    61  SpeedStor       a9  NetBSD          f2  DOS secondary
17  Hidden HPFS/NTF 63  GNU HURD or Sys ab  Darwin boot     fd  Linux raid auto
18  AST SmartSleep  64  Novell Netware  b7  BSDI fs         fe  LANstep
1b  Hidden W95 FAT3 65  Novell Netware  b8  BSDI swap       ff  BBT
Hex code (type L to list codes): 82
Changed system type of partition 5 to 82 (Linux swap)
Command (m for help): p
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          25      200781   83  Linux
/dev/sda2              26         391     2939895   83  Linux
/dev/sda4             392       30401   241055325    f  W95 Ext'd (LBA)
/dev/sda5             392         428      297171   82  Linux swap
/dev/sda6             429       30401   240758091   83  Linux

Saving the new partition table to the hdd

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
sh-2.05b#reboot


warning if you deleted all the partitions this reboot won't work. It will work only if you left /dev/sda1 untouched. You can destroy and resize all the other partitions.

firmware-update

choose a firmware of your choice and use the firmware updater to flash the image to the harddisk.
you can choose to update the hddrootfs only if you use the debug-options of the firmware updater.

format the data disk

customized original firmwares

jtymods firmware or telnet enabled stock firmwares can format the hdd over the webinterface.

freelink

  • use mkfs.ext2/mkfs.ext3/mkfs.xfs to create the filesystem on /dev/sda6
  • use mkswap to create the swap filesystem on /dev/sda5
  • modify your /etc/fstab accordingly to the filesystem-type

Partitions after firmware update

i already started to untar the big tarball with all my LS-development stuff from the usbstick
at /mnt/usbdisk2 to /mnt/ls_config. thats why /dev/ls_disk1_1 (=/dev/sda6) isn`T completely empty.

root@LS-PRO:~# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/sda2              2907124    183660   2723464   6% /
/dev/ram1                15360        96     15264   1% /mnt/ram
/dev/ls_disk1_1         194443     10384    174020   6% /boot
/dev/ls_usbdisk2_1      991752    552268    389104  59% /mnt/usbdisk2
/dev/ls_disk1_6      240544192    234384 240309808   0% /mnt/disk1

Additional info

What are these partitions for?

/dev/sda1: the partition which normally gets mounted to /boot.
if this partition gets full you get this acp-error when you try to reflash the box
(in that case you have to delete some old files of the hddrootfs there)

/dev/sda2: here is the normal unpacked rootfs stored. in fact this is / while in hddrootmode.

/dev/sda4: this is an extended partiton. it is just a container for /dev/sda5 + /dev/sda6

/dev/sda5: this partition is used for swap

/dev/sda6: the partition which normally gets mounted to /mnt/disk1/
this is where all your shares + data is stored.

Even more partitions, to ease your life (sort of making the partition scheme future-proof)

Those who need it may create additional partitions at the end of the large data partition /dev/sda6, thus keeping the partitioning scheme as before up to this partition (might keep the firmware updater happy on future updates), and making the data saved on them persistent during future firmware or OS upgrades / changes, without having to backup everything.
Of course, they are optional, you can certainly do without them, it's just a proposal. Even better, if you just create them while you still can (no data yet on the big partition) and just mount them when the time comes, it's just good practice to be prepared...

/dev/sda7: While some users install an alternative firmware on the LSpro, if they choose a full OS like Debian or Gentoo, they might even want to use the box as a home LAN server, maybe with centralized authentication (for Linux and Windows via Samba + OpenLDAP). In that case, it's common to have the /home in Linux and also the Windows user profiles mounted from the server. It is then very advisable to have a separate partition on the server for this, which will hold user settings, important documents for few users in a household. Big files would be off-loaded to the large data partition anyway. You should know how big you'd make this partition, according to your needs.

/dev/sda8: An extra partition for OS-es like Gentoo, in which to hold the whole package database files, downloads and binaries built on the poor LSpro, which would only bloat the root files system, and also in order to have them ready to use after a major Gentoo re-installation.
Of course, if you don't create this partition, you can still use a symlink to a directory on your large data partition for this purpose. If you create it, well, a size of 3 to 4GB would be good, as you might want to export these directories to other Gentoo machines in your LAN, too. More info when the upcoming Genlink for LSpro is released.

what is the best way to backup the data from EM if you still have something important on your disk?

this was the case for me..i wanted to rescue the folder where i had all my linkstation-related stuff...
GPL, compiled apps and so on.

i only had a 1 GB USB-Stick, but this obviously also works with a big usbdisk.

1) while in EM Mode connect your usbstick/hdd to the LS Pro
2) create a linux partition on the usbstick/hdd

fdisk /dev/sdb
d
n
p
1
<enter>
<enter>

3) now you have a linux partition which covers the complete usb-disk/stick
4) create an ext2 filesystem on the disk (FAT is NOT supported by the kernel while in the Ramdisk)

 mkfs.ext2 /dev/sdb1

5) manually mount the usb-stick/disk to /mnt/usbdisk1

 mount /dev/sdb1 /mnt/usbdisk1

6) mount the data partition of the internal hdd to /mnt/disk1

 mount /dev/sda6 /mnt/disk1

7a) now you can copy all the things to the other disk with cp or mv

cp /mnt/disk1/<source> /mnt/usbdisk1/<target>
mv /mnt/disk1/<source> /mnt/usbdisk1/<target>

you can use the -r switch for recursive as well.

7b) or use tar (this again is recursive):

tar -czvpf /mnt/usbdisk1/<target>.tar.gz /mnt/disk1/<source>

7c) or even use cpio and find; quick guide at: http://jeremy.zawodny.com/blog/archives/010037.html

mkdir /mnt/usbdisk1/<target>
cd /mnt/sda1
find . -print | cpio -Bpdumv /mnt/usbdisk1/<target>

how do i read that linux usbhdd/usbstick i used for backup?


possibly you need to use fix_ext2_magic befor you are able to access...
'!!We need to port fix_ext2_magic to arm9!!'
(it isn`t able to compile on the LS pro currently)

Windows: www.fs-driver.org or http://www.diskinternals.com/linux-reader/
Linux: just mount the ext2-filesysytem