-   Ubuntu (
-   -   Custom debootstrap build live cd slow write speed on ssd (

kktester 04-13-2013 09:25 PM

Custom debootstrap build live cd slow write speed on ssd
I have been building a live cd based on ubuntu 12.04 with kernel 3.2.0-38-generic ( usind debootstrap ) and everything runs fine, except I find when connecting to a NTFS drive writing to the drive is very slow. If I do the same test with the standard ubuntu live cd the write speed is far greater.
Just to note, both are run off a usb stick and the NTFS drive is my internal SSD drive.

The only thing I can think of is I am missing a package. I am explictly installing ntfs-3g. Is there anything else I should be including.

Please note, this seems to be a problem regardless of which desktop I try.Eg:
lubuntu-desktop or ubuntu-desktop packages.

The test I do is to copy a large file to ram rename it and then copy it to the ssd drive. My builds take 3 times as long to copy. Also my USB 3 drive seems to suffer the same way slow write speed ( althout this may be another issue ).

This is my full list of packages I install
discover laptop-detect os-prober casper lupin-casper linux-firmware linux-image-3.2.0-38-generic xorg ntfs-3g ubuntu-desktop

Thanks for any ideas you can share

business_kid 04-15-2013 04:11 AM

the definitive test is hdparm -tT /dev/disk

On internal disks, that's caused by the motherboard chipset driver being wrong. On USB disks, naturally, I would suspect the usb driver in the first instance. On your system, small disk cache in ram could also be an issue.

kktester 04-16-2013 07:53 AM

Thanks for the reply. When I run the command all looks good... I think
sudo hdparm -tT /dev/sda

Timing cached reads: 13500 MB in 2.00 seconds = 6753.68 MB/sec
Timing buffered disk reads: 1450 MB in 3.00 seconds = 483.24 MB/sec

The problem is writting to the disk.

I am interested in your comments, can you provide more information how I can check/change the cache size.

As I said before the first copy I do to the drive is fast. After that though, the speed goes way down. I does not matter if I umount the drive it stays slow on writes.

business_kid 04-16-2013 01:16 PM

I'm not the expert on this, but that's pointing to mount options. I stuck an SSD into this box, scratched for what options to use, and ended up this way for each partition:


/dev/sda6        /home            ext4        noatime,diratime,discard        1 2
It does need more regular checks than normal disks. No clue how to check cache size - google is your friend there.

kktester 04-17-2013 01:56 AM


Thanks for the reply... I tried noatime,diratime,discard but when I checked with the mount command only noatime was set.
Maybe this is because my drive is NTFS, I dont know.

Here is the mount options for the drive after adding your suggestion
/dev/sda2 on /media/Windows7_OS type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096) [Windows7_OS]
and if I auto mount without your options
/dev/sda2 on /media/Windows7_OS type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096) [Windows7_OS]

Anyway, the more I look at this the less I think its to do with settings and more to do with a missing package. If it was the cache or the mount settings I would expect to be able to reset it by umounting the drive. But the write speed just keeps getting slower.

I am in the process of checking each package and comparing it with the ubuntu live cd.

If you have any other suggestions please let me know

business_kid 04-17-2013 05:14 AM

I'm thinking you may have a small disk cache in the scheme of things when you have a large file in ram. Try this command

time cp file > disk; time sync

Either way, a pc is full of bottlenecks. You are never going to be able to feed a disk at near 480MB/S. Where's it going to come from? A better test might be to use a fifo, (first in, first out). In your ram disk try something along these (untested) lines
prep in your ramdisk:
mkfifo test.fifo

The test:
time dd if=/dev/zero of=test.fifo & time dd if=test.fifo out=/ssd/somefile

I would expect that to achieve about 1/3 of your ram speed as reported by memtest, provided no bottlenecks exist. When you think that ram access times is of the form 6-1-1-1, you'll realise that the '6' is a significant bottleneck. Is the task getting 100% cpu time? How wide is your disk access? Many chips haven't the width in hardware they really require. This has the benefit that test.fifo stays small. Set size limits, and you should get all the statistics you want.

kktester 04-19-2013 12:57 PM

I have been playing with Puppy linux to see how it compares with Ubuntu and I cannot repeat the problem when running puppy linux. I also found that I get the same write access slow rate using the standard ubuntu live cd ( it just takes a few copies to get the slow write speed ). Needless to say that when I run Windows 7 64 bit as the OS I have the same performace as Puppy linux.

For your info, I have a Thinkpad X220 with I7 sandbridge processor and 8GB of 1300 MHZ RAM. Also when I copy a 3.5GB file to ram it takes around 15Secs and about 30 secs to copy it back to disk. The second time, the read speed is the same but the write speed goes to 1:40 secs. Doing the same with Puppy linux seems to cause no delays in the write ( in both tests the CPU hardly shows any use ).

I have also tried umounting the ram disk I create for the file copy and remounting it but the performace stays slow.

So either I dont know what I am talking about or there seems to be a issue with Ubuntu 12.04 and writing to SSD drives.

business_kid 04-20-2013 03:56 AM

Did the sync commands change your test results?

kktester 04-20-2013 08:19 PM

No the sync showed the same timing as before. I am trying to figure out what the difference between puppy linux ( percise ) and ubuntu is and why puppy seems to handle ssd access better.

All times are GMT -5. The time now is 03:15 PM.