Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Other discussions > Linux and software for Linux
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 12-23-2010, 03:28 PM
Stream Recorder
 
Posts: n/a
Default

How to partition Samsung HD204UI in Ubuntu Linux (hdd w/advanced format technologies)


Samsung HD204UI uses Advanced Format Technology(AFT). AFT utilizes the storage surface area more efficiently while enabling the integration of stronger error correction algorithms to maintain data integrity at higher storage densities. The problem is that if you partition your hard drive like an ordinary drive, its performance can be slowed down significantly.

But let's see how Windows 7 partitions the HDD first. The first partition will occupy 1GB and the second one the rest of the disk. After partitioning with Windows 7 fdisk shows the following:
Code:
Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048  2097285119  1048641536   83  Linux
/dev/sda2      2097287168  3907024895   904868864    7  HPFS/NTFS
Note that the first sector is a multiple of 8 (and even 64 and 2048).
And the last sector sector or the first partition is 2097285119, not 2097287167.

If we partition the disk using the first sector that is a multiple of 64 and the last sector 2097287167:
Code:
Device Boot      Start         End      Blocks   Id  System
/dev/sda1              64  2097287167  1048643552   83  Linux
/dev/sda2      2097287168  3907024895   904868864    7  HPFS/NTFS
then Windows 7 doesn't see this partition.

Let's make the number of blocks of the first partition a multiple of 64:
Code:
 Device Boot      Start         End      Blocks   Id  System
/dev/sda1              64  2097287103  1048643520   83  Linux
/dev/sda2      2097287168  3907024895   904868864    7  HPFS/NTFS
So the first sector is a multiple of 64 and the number of blocks is a multiple of 64. Format this first partition to NTFS and Windows 7 should see it. Since it works and less space is wasted, compared to partitioning with Windows 7, we will use this variant.

p.s.
Why did Windows 7 start from sector 2048 and made a number of blocks a multiple of 2048? M$ has its own standards.

How to partition Samsung HD204UI in Ubuntu Linux (hdd w/advanced format technologies)

In this example I will create 2 primary partitions. In each case the first sector of the partition is a multiple of 64 (not the default value offered by fdisk) and the number of blocks is a multiple of 64. While making the first sector a multiple of 8 should be enough, if you plan to use the NTFS file system, it makes sense to make everything Windows 7 compatible.
  1. Run fdisk as a root
    Code:
    username@computername:~$ sudo -i
    [sudo] password for username: 
    root@computername:~# fdisk -u /dev/sdb
    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel with disk identifier 0xdbe01f20.
    Changes will remain in memory only, until you decide to write them.
    After that, of course, the previous content won't be recoverable.
    
    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
    
    WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
             switch off the mode (command 'c').
    Where /dev/sdb is your hard drive.
    Note that if you skip the "-u" switch, then fdisk will show sizes in cylinders, not sectors!
  2. Make sure you work with Samsung HD204UI
    Code:
    Command (m for help): p
    
    Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
    255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x33663f80
    
    
       Device Boot      Start         End      Blocks   Id  System
  3. Create a new primary partition
    Code:
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 1
    First sector (63-3907029167, default 63): 64
    Last sector, +sectors or +size{K,M,G} (64-2097287167, default 2097287167): 2097287103
  4. Create another primary partition

    We will start the second partition from the sector 2097287104, again a multiple of 64. But this time we won't care about the number of blocks:
    Code:
    Command (m for help): n
    Command action
       e   extended
       p   primary partition (1-4)
    p
    Partition number (1-4): 2
    First sector (2097287104-3907029167, default 2097287104): 2097287104
    Last sector, +sectors or +size{K,M,G} (2097287104-3907029167, default 3907029167): 
    Using default value 3907029167
  5. Show the results of partitioning
    Code:
    Command (m for help): p
    
    255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x33663f80
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1              64  2097287103  1048643520    83  Linux
    /dev/sdb2      2097287104  3907029167   904871032   83  Linux
  6. Write the changes
    Code:
    Command (m for help): w
    The partition table has been altered!
    
    Calling ioctl() to re-read partition table.
    Syncing disks.
  7. Format your new partitions

I've formatted the first partition to EXT4 and gave it the ext4 label. Then I did a couple of speed tests:
  • Code:
    username@computername:~$ sudo hdparm -i /dev/sdb | grep Model
     Model=SAMSUNG HD204UI, FwRev=1AQ10003, SerialNo=S2H7J9CZB05820
    
    username@computername:~$ sudo hdparm -t /dev/sdb
    
    /dev/sdb:
     Timing buffered disk reads:  412 MB in  3.01 seconds = 136.74 MB/sec
  • Code:
    username@computername:~$ sudo dd if=/dev/sdb of=/dev/null bs=128K count=20000
    20000+0 records in
    20000+0 records out
    2621440000 bytes (2.6 GB) copied, 17.4932 s, 150 MB/s
  • Code:
    username@computername:~$ sudo dd if=/dev/zero of=/dev/sdb bs=128K count=20000
    20000+0 records in
    20000+0 records out
    2621440000 bytes (2.6 GB) copied, 18.2465 s, 144 MB/s
  • Code:
    username@computername:~$ dd if=/dev/zero of=/media/ext4/000.dd bs=128K count=100000
    100000+0 records in
    100000+0 records out
    13107200000 bytes (13 GB) copied, 128.477 s, 102 MB/s

After formatting both partitions to NTFS, I can open them in Windows 7 without any problem.

Last edited by Stream Recorder : 12-29-2010 at 01:44 PM. Reason: updated to make partitions Windows 7 compatible
Reply With Quote
Reply Post New Thread
Tags: , , , , , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 04:57 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons