How can I manually partition my B drive

Discussion in 'TiVo Series 1 - UK' started by ciper, Jul 30, 2007.

  1. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004

    Advertisements

    I have two blank drives and a completely stock original 40gb drive from a series 1 (used as a virgin image for the other two drives). I would like to create an extra partition on the B drive.

    My plan is to use the MFSLive cd which fixes the swap size bug in MFSTools combined with an LBA48 aware + version 1 swap header kernel.

    I would like to place a 512mb swap partition on the B drive and give it higher priority over the 512mb swap partition on the A drive for best performance (since database reads wont have to compete for swap access).

    So far I can't figure this out. I've posted it on other forums but no one ever replies. If you have ANY ideas (even dumb ones) please share because it might inspire me in the right direction!

    Thanks :)
     
  2. AMc

    AMc Active Member

    2,623
    0
    Mar 22, 2002
    East of England
    It seems the way you're headed is bound to cause problems at some point - an old drive, a non standard configuration, a second drive (increasing the probability of a failure anyway).

    I'm still running my old Fireball :eek: because to upgrade again I'd have to junk my recordings. I know one day the whole thing will go belly up and I'll have to start again but I'm hoping someone will have worked out a way to allow me to do a full backup with recordings from two drives into one large drive by then :) If you're starting from nothing I don't understand your reasoning for keeping an old small drive in the mix?

    I can't help you directly - but why aren't you just using the original 40GB drive to create a backup and then create a working image on a single large drive?
     
  3. mikerr

    mikerr TiVoCentral.co.uk

    2,599
    0
    Jun 2, 2005
    Lancashire, UK
    Nice idea but in practice the tivo really isn't being slowed down by its swap access in most things.

    A 512MB cachecard hosts the whole database in its RAM, but its really only faster on:
    • Rearranging season passes using the tivo UI
    • Opening now-playing when you have 10+ pages of recordings

    Also some people have upgraded the tivo RAM on the mainboard (reducing the need for swap) and didn't gain much difference in noticable GUI speed.

    The only reason to use two drives is if you want the extra capaity they afford - .e.g. 2x 400GB drives ;)
     
  4. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004
    I already got a 700MB version 1 swap working on the B drive but the rest of the drive wasn't being used for recordings.

    Before my recent A drive crash I had 360gb of recordings and it was excruciatingly slow much of the time. I also plan to upgrade the ram once the system is stable and my ultra fine tip soldering tip comes in. Any suggestion on how to increase the speed? I already have a 512MB cachecard.


    I wasnt clear in my first post. The 40gb drive is the source of a virgin image which will (has already) been placed on a 500gb A drive and a 200gb B drive.

    I have already experiment with a 700mb swap on the A drive as well as a swap file inside of the var partition.
    I'm surprised your original drive is still functioning. My Tivo has already killed two drives - most recently being a 200gb seagate.
     
  5. mikerr

    mikerr TiVoCentral.co.uk

    2,599
    0
    Jun 2, 2005
    Lancashire, UK

    Advertisements

    Install a Cachecard with 512Mb RAM. ;)

    Soldering some ram onto the mainboard (moving tivo from 16Mb to 32Mb)
    isn't enough to cache the full database like the cachecard does.

    The member that did this saw no real difference IIRC .. can't remember who it was though.
     
  6. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004
    I already have a 512mb cache card. Still slow as hell when I had 360gb of recordings. Now I have the potential for nearly double that so I want to set this thing up correctly from the get go.
     
  7. mikerr

    mikerr TiVoCentral.co.uk

    2,599
    0
    Jun 2, 2005
    Lancashire, UK
  8. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004
    Damn! Thanks for the link. I was on the right track all along. For some reason I couldn't get these steps to work on the MFSLive cd. MFSadd was generating an error which I can't remember at the moment.

    If I remember right mkswap and swapon don't function correctly even with byteswapping turned on so I will try to use tpip to format the partition once pdisk has created it.

    Theoretically if I set the priority of both swap partitions to be equal wouldn't the kernel stripe the writes to both?

    Ill let you guys know :)

    edit: BTW guys if you use one of the modified kernels from the TPIP site it will enable version 1 swap files/partitions so you can create swaps of any size (upto 2gb each). The original Tivo kernel can only support version 0 which has the 127mb limit. If you insist on using the stock kernel you can create multiple 127mb swap partitions.
     
  9. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004
    A small update - I did a non destructive test on my B drive already with some success. My B drive had 13mb of left over unpartitioned space so I created a partition and used mkswap on the tivo to initialize it. Swapon was able to use this swap just fine. The only problem is that the standard mkswap binary on the tivo only creates version 0 swaps...

    I tried to use tpip to initialize the swap file but it can only work against the A drive.

    Any suggestion on a swap initialization tool that respects byte swapping and will work against the B drive?

    edit: I have found an updated version of mkswap for the tivo that will create version 1 swaps!

    I just wish there was a utility for the PC that could create version 1 swaps on the B drive.

    edit2: Found it! http://www.************.com/forum/showthread.php?p=224882&highlight=mkswap#post224882 replace the stars with you know what ;)
     
  10. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004
    I wanted to post this for anyone else who finds my post later on.

    The Tivo does NOT support more than one swap entry in the FSTAB!

    I tried for hours every combination of swap layouts/configurations in the fstab. No matter how you form the entries the tivo will never boot if the fstab is edited to list more than one swap entry. Its hard to troubleshoot because no logs are created (since its so early in the boot process). You have no fricking idea how many times I swapped the drives between my PC and the tivo......

    There is a workaround though! I didn't want to only list the swap partition on the B drive so instead I did the following -

    Modify the fstab swap line options to give /dev/hda8 a priority number
    Code:
    /dev/hda8 swap swap    sw,pri=3 0 0
    Then at the top of your rc.sysinit add the following line (with the appropriate location)
    Code:
    swapon -v -p 5 /dev/hdb4
    This makes the TV add the extra swap an the -p 5 gives it a higher priority (used first) over the original swap with priority 3

    I've tested this on an S1 and verified it works. If you are still using the stock kernel this method allows you to create multiple swap files upto 127mb each and should allow mfsfix GSOD to complete

    Can someone verify that the rc.sysinit is started when a GSOD is initiated?


    edit: Kernel log entries to prove this from my most recent reboot
    Code:
    Jan  1 00:03:18 (none) kernel: Activating swap partitions
    Jan  1 00:03:18 (none) kernel: Adding Swap: 716796k swap-space (priority 3)
    [i](time passes as other items are loaded)[/i]
    Jul 31 06:12:58 (none) kernel: Adding Swap: 13492k swap-space (priority 5)
     
  11. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004
    Deleted, see my next post
     
  12. blindlemon

    blindlemon tivoheaven.co.uk

    5,577
    0
    May 12, 2002
    Malmesbury, UK
    I thought that might happen :(

    Personally I doubt whether you will see any performance benefit from putting the swap on the B drive. However, you could try doing an MFSadd with a non-LBA48 version of the boot disc (to use 137gb only) then rebooting into a LBA48-aware environment, rebuilding the partition table (to pick up the extra free space) and adding a swap partition with pdisk, then running mfsadd again....
     
  13. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004
    I THINK I'VE DONE IT
    Here are the steps I took -

    My drive layout is as follows
    /dev/hda - 40gb original unmodified Tivo drive
    /dev/hdb - MFSLive CD
    /dev/hdc - New A drive for Tivo
    /dev/hdd - New B drive for tivo
    /dev/sda1 - usb stick for files not included on MFSLive cd (new kernel, modified mkswap etc..)

    Previously my backup|restore went at around 1.5mbps. I used "hdparm -a 255 -c 1 -k 1 -m 16 -S 0 -u 1 /dev/hda /dev/hdc /dev/hdd" to speed it up. Do not enable DMA as it breaks bite swapping

    Create the correct layout on the B drive the long way
    Code:
    backup -qso - /dev/hda | restore -s 700 -r 4 -xzpi - /dev/hdc /dev/hdd
    Delete the Tivo partitions so the B drive only has 1 partition type "apple_partition_map" name "apple
    Code:
    pdisk /dev/hdd
    d (delete)
    2 (application partition
    d (delete)
    3 (media partition
    Reimage A drive without B drive (use the up arrow so you don't have to type it again)
    Code:
    backup -qso - /dev/hda | restore -s 700 -r 4 -xzpi - /dev/hdc
    Create new swap partition on B drive
    Code:
    pdisk /dev/hdd
    C (upper case - create partition with type)
    64 (starting block of free space)
    1440000 (length in blocks - tried to get 700mb end up with 713mb)
    "Linux Swap" (name of partition and the quotes are necessary!)
    Swap (type of partition)
    C (create)
    1440064 (start of application partition)
    2048 (length results in 1mb)
    "New MFS Application" (name, don't forget quotes)
    MFS (type)
    C (create)
    1442112 (start of media partition)
    389279856 (rest of remaining space on drive)
    "New MFS Media" (name with quotes)
    MFS (type)
    w (save changes)
    Y (yes to overwrite)
    q (quit)
    Now you can add the new space
    Code:
    mfsadd -r 4 /dev/hdc /dev/hdd3 /dev/hdd4
    Using a modified version of mkswap which supports bite swapping is the only way to accomplish this on the PC. Otherwise even with byte swapping enabled on the boot cd it WON'T WORK. You can skip this step if you have a modified version of mkswap on the tivo that can create version 1 swap partitions.
    Code:
    mkswap -S /dev/hdd2
    thoughts?
    edit: Oh yeah don't forget to copy over a modified kernel that supports both lba48 AND version 1 swaps or none of this will work!
     
  14. mikerr

    mikerr TiVoCentral.co.uk

    2,599
    0
    Jun 2, 2005
    Lancashire, UK
    Now you need to create a few hundred season passes and entries in now playing

    Then we can see benchmarks of say, re-ordering season passes and first entry into now-playing ... with and without the swap on B drive.
     
  15. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004
    I used to have about 35 season passes before my A drive crapped out.

    Is anyone reading this? Anyways here is a printout of my memory information after a fresh reboot of the system
    Code:
    bash-2.02# cat /proc/meminfo
            total:    used:    free:  shared: buffers:  cached:
    Mem:  14274560 14114816   159744 66727936   487424  4706304
    Swap: 1471266816        0 1471266816
    MemTotal:     13940 kB
    MemFree:        156 kB
    MemShared:    65164 kB
    Buffers:        476 kB
    Cached:        4596 kB
    SwapTotal:  1436784 kB
    SwapFree:   1436784 kB
    Yes thats 1.4gb of swap on a series 1 tivo :) I know this is completely unnecessary but here is my reasoning. I wanted to have 1mb of swap for every 1gb of disk space. I wanted to move the swap partition to the B drive for better performance and I wanted to have a swap partition on the A drive in case something happens to the B drive.
    Here are the relevant Kernel log entries
    Code:
    [i]My custom entrie at the start of rc.sysinit[/i]
    Jan  1 00:03:18 (none) kernel: swapon on device /dev/hdb2 
    Jan  1 00:03:18 (none) kernel: Adding Swap: 719996k swap-space (priority 5) 
    ...
    [i]The regular swapon -a in the middle of rc.sysinit that reads fstab with /dev/hda8[/i]
    Jan  1 00:03:18 (none) kernel: Activating swap partitions 
    Jan  1 00:03:18 (none) kernel: Adding Swap: 716796k swap-space (priority 3)
     
  16. AMc

    AMc Active Member

    2,623
    0
    Mar 22, 2002
    East of England
    I'm still reading, I don't get most of it as I'm neither a Linux nor MFS nut but I'm interested in your results. When my fireball does give in I will want to upgrade to the fastest and largest possible system so anything you learn will help us all in the long run.
    Thanks for taking the time to update the thread even if most of us can't help you :)
     
  17. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004
    Does anyone know of a way to benchmark file system reads? Would copying a file to null and timing how long it takes be accurate? I've read about two more changes (noatime and data=writeback) Ill try to make which should further increase performance but I want to test it before writing too much about it.

    Also is their anyway to do a graceful shutdown of the system? Even choosing "restart the recorder" essentially crashes it requiring fsck to run at startup against the var partition. Can I sync the discs and remount var as read only before rebooting? Does anyone have a copy of the reboot binary?

    AMc: Why not upgrade now and save the drive? The best thing I ever did was to save the original virgin quantum drive. It makes recovering from a mistake (or failed drive) SOOO much easier. The longest part of recovering from my drive failure was trying to find where I stuck the fireball!

    Im actually not an MFS or Linux nut either. I probably did this the hardest way possible and hope that eventually someone will come look. One thing I did find out is that if you set the swap priorities to equal numbers it will actually stripe the writes to them which gives the effect of a raid. I almost did this but I thought freeing the database drive from swapping would be the best option.

    It was REALLY stupid that DMA breaks byteswapping. I literally spent 2 hours trying to figure out what the hell was happening. Im guessing that Hdparm -d 1 works fine on the tivo because byteswapping is always enabled.

    I should point out that the biggest improvement of speed on the Tivo by far has been the following addition to the top of rc.sysinit
    Code:
    hdparm -a 255 -c 1 -d 1 -k 1 -m 16 -M 1 -S 0 -u 1 /dev/hda /dev/hdb
    My Tivo is still pretty empty but I can say that with 16 season passes I can reorder them WAY faster than what I was used to be.
    BTW Im not in the UK. I use this forum because there is no one helps or listens to S1 users anywhere else.
     
  18. mikerr

    mikerr TiVoCentral.co.uk

    2,599
    0
    Jun 2, 2005
    Lancashire, UK
    That wouldn't hit the disk though ... would be best copying to /var
    On the tivo itself? or from telnet?

    /sbin/restart instead of /tvbin/reboot ?
     

    Attached Files:

  19. ciper

    ciper Active Member

    2,011
    1
    Nov 4, 2004
    edit: Deleted old idea. This is better.
    To test disk speed. Refer to "real" time and final size of file.
    Code:
    echo "start 50mb write"
    time dd if=/dev/zero of=/var/hack/testfile bs=50000k count=1
    echo "start 50mb read"
    time dd if=/var/hack/testfile of=/dev/null bs=1000k
    echo "size of file in kilobytes"
    ls -k -s testfile | cut -d ' ' -f 1
    rm /var/hack/testfile
    As for testing the speed of the B drive I can only figure out how to do reads without creating another partition in the left over space
    time dd if=/dev/hdb2 of=/dev/null bs=1000k count=50

    Hehe all this testing and look what I made!
    bash-2.02# ps ax
    PID TTY STAT TIME COMMAND
    566 p0 TW 0:00 (bash)
    568 p0 Z 0:53 (dd <zombie>)
    598 p0 RW 0:00 ps ax

    A zombie! If I give it brains will it go away?
    From any place. They all seem to just crash the system. Ill check if the reboot binary does it too.
    Edit2: Sigh even the reboot binary you gave me does it. No wonder people keep getting their var partitions erased.
     
  20. AMc

    AMc Active Member

    2,623
    0
    Mar 22, 2002
    East of England
    I have a virgin Tivo image from when I upgraded my folks to a helpful thread on here. The original 30GB drive has been my B for years and the 15GB went off in an old PC - I upgraded to the 120GB +30GB when the 120GB dropped below £100 :)
    The main reasons for running it 'until the wheels fall off' is that I'd definitely lose recordings thanks to the previous upgrade path. I'm hoping that the later MFSLive (?) work will eventually create a method that will allow me to upgrade to a single 500GB and keep my recordings.
    In the mean time I watch my Dailymail and keep an eye out for sticking and stuttering recordings...
     

Share This Page

spam firewall

Advertisements