Filesystem

From WL-HDD Wiki

Jump to: navigation, search
WL-HDD Contents
What is the WL-HDD
Features
Pro's/con's
Reviews
Hacking
Inserting the HDD
Hacking Guides
Basic setup guides
Packages guides
Requests
Troubleshooting
This Wiki
Credits
Editing help
Contact Me

Contents

Prerequisites

It is assumed that:

  • This is a fresh install of Olegs Firmware
  • Stupid-ftp has been disabled.
  • The hard disk has not yet been formatted whilst using Oleg's firmware.

If some of the above is not true, it may not make much difference. It is however essential that Stupid-ftp has been disabled or the hard disk will refuse to unmount.


Putty

The first thing you need to do is to open a telnet client.

This will allow you to login to your WL-HDD.

I recommend using putty

In the host name box, you need to insert the ip address of your WL-HDD (192.168.1.8 in my case).

Now Login to your router, use the same username and password you use for the web-interface.

this picture shows you what putty should look like
this picture shows you what putty should look like


Making Partitions

Chances are, the router probably auto-mounted your hard disk to /tmp/harddisk or somewhere else.

This is not the desired configuration so we will change it.

  1. Type df into the terminal. You should see something similar to the picture below but with /tmp/harddisk instead of /opt


  1. In my case, the hard disk was mounted to /tmp/harddisk
  2. To unmount, I therefore type
umount /tmp/harddisk

change /tmp/harddisk to suit your setup, depending on what you get when you type df

  1. If you get a message complaining that the hard drive is in use, check you disabled stupid-ftp.
  2. If you still get the message, you need to kill some other processes, you can probably kill most processes apart from these:
  PID  Uid     VmSize Stat Command
   1 jono        564 S   /sbin/init
   2 jono            SW  [keventd]
   3 jono            SWN [ksoftirqd_CPU0]
   4 jono            SW  [kswapd]
   5 jono            SW  [bdflush]
   6 jono            SW  [kupdated]
   7 jono            SW  [mtdblockd]
  39 jono        320 S   telnetd
  50 jono            SW  [khubd]
  75 jono        536 S   -sh
  93 jono        384 R   ps -e
  • now type
fdisk /dev/discs/disc0/disc , fdisk is a linux partitioning utility
  • Here is a list of the fdisk functions
Command action
       a       toggle a bootable flag
       b       edit bsd disklabel
       c       toggle the dos compatibility flag
       d       delete a partition
       l       list known partition types
       m       print this menu
       n       add a new partition
       o       create a new empty DOS partition table
       p       print the partition table
       q       quit without saving changes
       s       create a new empty Sun disklabel
       t       change a partition's system id
       u       change display/entry units
       v       verify the partition table
       w       write table to disk and exit
  1. A wizard will now launch and you need to input the following:
d (this command makes sure you have deleted any existing partitions. Repeat until there are no partitions left). Choose 1 then 2 etc.
n (new partition)
p (primary partition)
1 (partition number 1)
<enter> (the default cylinder should be 1!)
+10000M (this makes a 10GB partition). This is just preference but should be at least 20MB or so.

This has just created the storage partition for us, now we need to make a swap partition.

n (new partition)
p (primary partition)
2 (partition number 2)
<enter> (this uses all the remaining disk space as swap space. You don't have to use this default setting.
<enter> (to finish)
t (set partition type)
2 (chooses the second partition- the one we want to be a swap partition)
82 (this hex code tells fdisk that it is a swap partition.
w (this writes the new partition table with your new partitions).

Filesystems

Finally, we need to make a secondary filesystem and make the swap space.

mke2fs -j /dev/discs/disc0/part1 < enter > (this makes an ext3 format filesystem).
mkswap /dev/discs/disc0/part2 < enter > (this creates the swap space).

If you get an error message saying "writing inode tables: Terminated", try to create and mount the swap partition first, and create the ext3 filesystem on part1 afterwards.

If you get an error message saying "/dev/discs/disc0/part1: Memory allocation failed while setting up superblock ", create the swap partition first, run the swapon /dev/discs/disc0/part2 command and create the ext3 filesystem on part1 afterwards.

Mounting the filesystem

The filesystems cannot be lost on a reboot so we are now going to reboot the router

reboot
  • Login again using telnet.
  • Unmount the automatically mounted partition if necessary (check out this section again).
  • now we will mount partition one to /opt . You may need to make this directory?
mount /dev/discs/disc0/part1 /opt < enter >
  • We also need to activate the swap partition
swapon /dev/discs/disc0/part2 < enter >

Thats about it. However, note that as there is no process that calls these manual mount commands, the partitions will have to be manually mounted every time the router is rebooted. To avoid this, proceed to install the IPKG package system. This will allow you to automatically mount after boot.


Another way

If you don't like fdisk at all and you have an opportunity to connect your harddisk to a PC you can use your favorite software (it must be capable to create Linux partitions) to make partitions on your harddisk. Just remember to create at least one primary partition of Linux ext3 type (may be ext2 can be used to but there is no reason to do so) and one swap partition. Then insert disk back to WL HDD and continue with Mounting the filesystem.

Personal tools