Articles in the Uncategorized category

  1. Mounting a File System or Partition From a Disk Image

    Sat 23 January 2010

    You cannot just make a disk copy with dd and then just mount it as a regular disk. You must know where the partition starts on the disk. So first, you need to get the partition table with sfdisk:

    sfdisk -l -uS image_file.dd

    The output is something like:

    Disk /mnt/image/image_file.dd: 9729 cylinders, 255 heads, 63 sectors/track
    Warning: The partition table looks like it was made
    for C/H/S=*/240/63 (instead of 9729/255/63).
    
    For this listing I'll assume that geometry.
    
    Units = sectors of 512 bytes, counting from 0
    
    Device Boot Start End #sectors Id System
    
    /mnt/image/simon-besmet.img1 63 8497439 8497377 b W95 FAT32
    /mnt/image/simon-besmet.img2 * 8497440 156280319 147782880 7 HPFS/NTFS
    /mnt/image/simon-besmet.img3 0 - 0 0 Empty
    /mnt/image/simon-besmet.img4 0 - 0 0 Empty
    

    Next, we need to calculate the actual starting point of the partition. The sector number is in sectors, which contain 512 bytes. So in this case, the starting point of the NTFS partition is 8497440 x 512 = 4350689280.

    To mount the image, enter the following command, using the calculated offset:

    mount -o loop,offset=4350689280 /mnt/image/disk_image.dd /mnt/disk
    

    Source:

    http://lists.samba.org/archive/linux/2005-April/013444.html

    Tagged as : Uncategorized
    If you have any comments email me, see the About page for contact details.
  2. 'Linux: Show Graphical Layout of Disk Temperatures'

    Sun 03 January 2010

    graphic, representation

    To get a visual representation of hard drive temperatures, I wrote a small script. The output of this script looks like this:

    imageThis output is tailored to the exact disk lay-out of my storage server. However, it is also usable for other servers. You have to edit the lay-out depending on the system.

    This script assumes that you have smartmontools installed on your system. It uses smartctl to obtain the drive temperatures.

    The script can be found here or here in tgz format.

    If you have any comments email me, see the About page for contact details.

Page 23 / 40