Quick Format and NMT Apps Install

From NMTWiki

Jump to: navigation, search

Image:Redvsmall.jpg Difficult - for advanced users, may require detailed technical knowledge, use at your own risk!

Image:warning.png Use these instructions with caution and at your own risk. Do not do this if you don't understand it.

Applicable only for the following:
PCH NMT models: A100/110/B110
Others NMT's: HDX/eGreat

For experienced Linux users. This shows how to format your hard drive and install the NMT apps in under ten minutes, without using the NMT setup wizard. For those experiencing problems formatting 1.5TB drives this guide should be especially useful.

Contents

Before you start

Download the latest firmware and extract the NMT apps, which are inside syb8634.nmt. You will also need to be able to telnet into your NMT. See Lundman's telnet page[1] (run off USB).

On your Linux PC

You will partition the drive, mkfs the two file systems, install the NMT apps, and do some miscellaneous housekeeping (creating directories and changing permissions, writing the swap space signature). Formatting a 1.5TB drive on the NMT looked like it would take over two hours, doing it on my laptop (running OpenSuse Live) took just a couple minutes. My /tmp/newpart.txt file looked like this (the number of sectors in the third partition may need adjustment if your drive is a different size than mine):

It looks like the partition sizes can be 252MB for the '/' and about 512MB for swap and the rest can be for your media files.

Partition the drive

# partition table of /dev/sdc
unit: sectors

/dev/sdc1 : start=       63, size=   514017, Id=83
/dev/sdc2 : start=   514080, size=  1012095, Id=82
/dev/sdc3 : start=  1526175, size=2928745890, Id=83
/dev/sdc4 : start=        0, size=        0, Id= 0

Linux commands:

linux:/home/linux # sfdisk /dev/sdc < /tmp/newpart.txt
Checking that no-one is using this disk right now ... 
OK                                                    

Disk /dev/sdc: 182401 cylinders, 255 heads, 63 sectors/track
Old situation:                                              
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

   Device Boot Start     End   #cyls    #blocks   Id  System
/dev/sdc1          0+ 182400  182401- 1465136001    7  HPFS/NTFS
/dev/sdc2          0       -       0          0    0  Empty     
/dev/sdc3          0       -       0          0    0  Empty     
/dev/sdc4          0       -       0          0    0  Empty     
New situation:                                                  
Units = sectors of 512 bytes, counting from 0                   

   Device Boot    Start       End   #sectors  Id  System
/dev/sdc1            63    514079     514017  83  Linux 
/dev/sdc2        514080   1526174    1012095  82  Linux swap / Solaris
/dev/sdc3       1526175 2930272064 2928745890  83  Linux              
/dev/sdc4             0         -          0   0  Empty               
Warning: no primary partition is marked bootable (active)             
This does not matter for LILO, but the DOS MBR will not boot this disk.
Successfully wrote the new partition table                             

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)

Format the partitions

First the partition which would be your root of the NMT

                                                         
linux:/home/linux # mkfs -t ext3 -j /dev/sdc1
mke2fs 1.41.1 (01-Sep-2008)                  
Filesystem label=                            
OS type: Linux                               
Block size=1024 (log=0)                      
Fragment size=1024 (log=0)                   
64256 inodes, 257008 blocks                  
12850 blocks (5.00%) reserved for the super user
First data block=1                              
Maximum filesystem blocks=67371008              
32 block groups                                 
8192 blocks per group, 8192 fragments per group 
2008 inodes per group                           
Superblock backups stored on blocks:            
        8193, 24577, 40961, 57345, 73729, 204801, 221185

Writing inode tables: done                            
Creating journal (4096 blocks): done                  
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Next the shared media partition where you store your media files

linux:/home/linux # mkfs -t ext3 -j -m 0 -T largefile4 /dev/sdc3   
mke2fs 1.41.1 (01-Sep-2008)                                        
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
357536 inodes, 366093236 blocks
0 blocks (0.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
11173 block groups
32768 blocks per group, 32768 fragments per group
32 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

Copy the NMT Applications onto the root partition after mounting it

linux:/home/linux # mount /dev/sdc1 /mnt
linux:/home/linux # dd if=/tmp/syb8634.nmt bs=60 skip=1 | (cd /mnt && tar xfz -)
403805+1 records in
403805+1 records out
24228316 bytes (24 MB) copied, 4.57992 s, 5.3 MB/s

Create the other directories on the share partition

 
linux:/home/linux # umount /mnt
linux:/home/linux # mount /dev/sdc3 /mnt                                     
linux:/home/linux # cd /mnt                                                  
linux:/mnt # mkdir Photo Video Music     
linux:/mnt # chmod 777 Photo Video Music     
linux:/mnt # cd /home/linux
linux:/home/linux # umount /mnt
linux:/home/linux # /sbin/mkswap /dev/sdc2
Setting up swapspace version 1, size = 518188544 bytes
linux:/home/linux #

You should be able to copy your media files into the respective directories - but you may have to change their ownership and access mode later on by using the "chown -R nmt.nmt *" and "chmod -R 777 *" commands on the Telnet session of NMT.

On the NMT

Disconnect the hard disk which you just prepared from your PC and fit it inside the NMT. Disconnect the NMT from your Linux PC and reboot it. You should see "HARD_DISK_A1" and "HARD_DISK_A3" under Media Source, as the NMT has not recognized your drive as having the NMT apps on it available to run. If this does not describe how your disk is mounted, you will need to slightly adjust these instructions.

You may need to refer to [2] and install telnetdaemon and get it running before attempting to go to the next step.

Start the telnet daemon and telnet into your NMT.

Linux commands: First let us see what NMT has mounted.

# mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,nodiratime)
devpts on /dev/pts type devpts (rw)
tmpfs on /tmp type tmpfs (rw)
none on /sys type sysfs (rw)
/dev/sda on /opt/sybhttpd/localhost.drives/USB_DRIVE_A type vfat (rw,nodiratime,uid=1001,gid=1001,fmask=0022,dmask=0022,codepage=cp437,iocharset=utf8)
/dev/hda1 on /opt/sybhttpd/localhost.drives/HARD_DISK_A1 type ext3 (rw,data=ordered)
/dev/hda3 on /opt/sybhttpd/localhost.drives/HARD_DISK_A3 type ext3 (rw,data=ordered)

We need to unmount some and do some changes as follows.

# umount /dev/hda1
# umount /dev/hda3
# cd /opt/sybhttpd/localhost.drives/
# rmdir HARD_DISK_A1 HARD_DISK_A3
# mkdir HARD_DISK
# mount /dev/hda1 /mnt
# mount /dev/hda3 /opt/sybhttpd/localhost.drives/HARD_DISK
# cd HARD_DISK
# chown nmt.nmt Music Photo Video
# cd /
# ln -s /opt/sybhttpd/localhost.drives/HARD_DISK /share
# cd /etc

Let us start the NMT daemon

# /etc/init_nmt start
SHAREROOT=/opt/sybhttpd/localhost.drives/HARD_DISK
Do chmod on /opt/sybhttpd/localhost.drives/HARD_DISK ...
Got /share/Video...
test: 2: unknown operand
test: 2: unknown operand
test: 2: unknown operand
/etc
Starting FTP Server...rm: cannot remove 'ms.pid': No such file or directory
rm: cannot remove 'httpd.pid': No such file or directory
Updating samba workgroup...
Updating samba password...Starting samba/mnt/syb8634/server

Now run the default setups

# /opt/sybhttpd/default/setups.cgi

At this point you should have an "NMT Applications" item in the Maintenance menu, and be able to start any of the NMT apps.

The following commands appear to be the key in making the NMT recognize your disk as having the NMT apps on it, and correctly mounting the two partitions on /mnt and /opt/sybhttpd/localhost.drives/HARD_DISK. Just starting the NMT apps with "/etc/init_nmt start" does not seem to be sufficient. I believe it is also the reason why tar'ing up /mnt off an already installed drive and untar'ing onto a new drive appears to work too (you've copied the file .hdinfo to the new drive).

# cp /etc/hdinfo /mnt/.hdinfo
# chown nmt.nmt /mnt/.hdinfo

At this point you can go into the NMT UI and you should see that "Typical Setup" is now available in the NMT Setup Wizard. If you want to be really safe, you can reinstall the NMT apps (without formatting the drive), but it seems to be running ok for me as-is. Reboot and make sure everything is running ok.

# /sbin/reboot
Personal tools