How can i format and finaly mount??

Hi guys,
i'm trying to create an image bootable from scratch, but i fell in error right at the beginning .
I've created an image filled by zero with
dd if=/dev/zero of=deb.iso bs=1M count=2048
after that i've partitioning this file with
cfdisk deb.iso
and the resultant partition table is
Disk ../deb.iso: 2 GiB, 2147483648 bytes, 4194304 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
Disklabel type: dos
Disk identifier: 0x114cf359
Device Boot Start End Sectors Size Id Type
../deb.iso1 * 2048 718847 716800 350M 83 Linux
../deb.iso2 718848 4194303 3475456 1,7G 83 Linux
At this point i've create a block devices for each partition, so
losetup -o $((2048*512)) /dev/loop0 ../deb.iso
losetup -o $((718848*512)) /dev/loop1 ../deb.iso
then i formatted it in ext4
mkfs.ext4 /dev/loop0
mkfs.ext4 /dev/loop1
and until here everything goes right.
Now i decided to mount my formatted loop devices, so
mkdir root
mount /dev/loop1 root
cd root
mkdir boot
but when i give the command for mount the /dev/loop0, this give me back an error
mount /dev/loop0 boot
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
The permission of directory and the privilege for mount devices it's ok.
I also tried mount the partition without use losetup, directly from
mount -o loop,offset=$((2048*512)) -t ext4 ../deb.iso boot/
or format directly the partition with
mkfs.ext4 -E offset=$((2048*512)) deb.iso
but always is the same.
My dmesg said:
[ 3123.395788] JBD2: no valid journal superblock found
[ 3123.395796] EXT4-fs (loop0): error loading journal
Can someone help me with this damn trouble?? Thanks you very much
Last edited by Gianlucode (2014-12-01 12:17:26)

How we are used to hear in computer science, Divide et impera!
I divided my deb.iso in 3 pices using dd. Remebering the partitions table
Gianlucode wrote:Disk ../deb.iso: 2 GiB, 2147483648 bytes, 4194304 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
Disklabel type: dos
Disk identifier: 0x114cf359
Device Boot Start End Sectors Size Id Type
../deb.iso1 * 2048 718847 716800 350M 83 Linux
../deb.iso2 718848 4194303 3475456 1,7G 83 Linux
I use dd in this way
dd if=deb.img of=deb.img.mbr bs=512 skip=0 count=2048
dd if=deb.img of=deb.img.0 bs=512 skip=2048 count=716800
dd if=deb.img of=deb.img.1 bs=512 skip=718848
To be sure that i haven't corrupted something i've calculeted the md5 hash of this file and the original
cat deb.img.mbr deb.img.0 deb.img.1 | md5sum
f33fed42eb63666d325e4fff796bfef9
md5sum deb.img
f33fed42eb63666d325e4fff796bfef9
So i was able to format my partitions and then mount them
mkfs.ext4 deb.iso.0
mkfs.ext4 deb.iso.1
mkdir root
mount deb.iso.1 root
cd root
mkdir boot
mount ../deb.iso.0 boot
touch boot/test
cd ..
umount root/boot
umount root
I've reassembled the image
cat deb.img.mbr deb.img.0 deb.img.1 > deb_final.img
and obviously if i recalculate the md5 is different then the initaly deb.img because i formatted and wrote some file in these partitions.
md5sum deb.img
f33fed42eb63666d325e4fff796bfef9
md5sum deb_final.img
b1b5656781b28803759d46ee67c428d5
To be sure, i've done the ultimately proof
sudo mount -o loop,offset=$((2048*512)) deb_final.img root
ls root
test lost+found
Et voilà there is the file test as i aspected.
Now do not forget to umont the partition
sudo umount root
I hope that this post will be useful for someone in future. If you have other solution to the initial problem, write it below.
Last edited by Gianlucode (2014-12-02 14:48:39)

Similar Messages

  • How can i format and verify Time Capsule? And: Corrupted backups?

    Since i did not see TC in the Disk Utility I am asking myself: How can I format the TC?
    And: Does anyone know if there is some kind of issue with the early delivered Time Capsules? My TC is becoming quite hot, the ventilator is running all the time and within the first 6 weeks i had two corrupted backups.
    Best Regards
    Georg
    Message was edited by: Georg H. Jeitler1

    Thanks for the info regarding formatting...
    So you don't know any frequently occuring issues with the first TCs that could match with these things?
    In other words: A TC that is always ventilating and that is becoming quite hot even if there is no computer online is "normal condition"?
    BTW: My TC is already updated to the latest firmware.
    Regards
    Georg

  • How can u insert and retrieve text files in any format using forms6i.

    how can u insert and retrieve text files in any format using forms6i.
    can u give me an example of an insert statement, let's assume the file is located in the a:drive.
    and retrieving the files, i would give the user a list of all the files that are in the database, the user would select one, but what command(or piece of code) would open the file in its apppropriate editor.
    e.g .pdf formatted file would open in acrobat.
    any help would be appreciated.
    Thanks
    Hussein Saiger

    the filereference class is for downloading and uploading files.
    if you want to load xml, use the xml class.
    and, if you want to write to an xml file and don't want to use server-side code, wait.

  • How can i format an iphone with an differant apple id ?... the phone is locked and it needs the original apple id to activate it which i dont have

    how can i format an iphone with an differant apple id ?... the phone is locked and it needs the original apple id to activate it which i dont have .... help me

    Moh'd . Hassan wrote:
    how can i format an iphone with an differant apple id ?... the phone is locked and it needs the original apple id to activate it which i dont have .... help me
    Then get the previous owner to remove it: Find My iPhone Activation Lock: Removing a device from a previous owner’s account - Apple Support

  • How can I format an HD with System 10.4 and install Leopard Snow?

    How can I format an HD with System 10.4 and install Leopard Snow?

    You need to partion the hard drive using Disk Utility. On one partition install 10.4. On the other 10.6. As a note I trust you are doing this on a MBP and not a PPC Mac because 10.6 won't install.

  • How can i format my macbook 10.5.8 to snow leopord i am doing first time  format how its process and do i need to formet or upgrade and i have a snow leopard DVD????

    how can i format my macbook 10.5.8 to snow leopord i am doing first time  format how its process and do i need to formet or upgrade and i have a snow leopard DVD???

    First, I'd advise you to make a backup. Time Machine is fine, but I recommend making a bootable backup with Carbon Copy Cloner if possible.
    Then, insert the Snow Leopard DVD (it's a retail version, right? Not a grey disk meant for another machine?) and run the installer on the disk. Should be automatic from that point in. You don't need to reformat your drive.
    Matt

  • How can i download and install lightroom after having formatted the hard disk?

    How can I download and install lightroom after having formatted the hard disk?
    I have the number of the order.

    Lightroom - all versions
    Windows
    http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Windows
    Mac
    http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Macintosh

  • How can I format footnote fonts in pages--for all footnotes in a document?

    I am just starting to use Pages and am writing a paper with footnotes.  The paper is in Times New Roman 12, but the footnotes come automatically in Helvetica 10.  How can I format all the footnotes so they automatically appear in TNR 12?

    Change one word in a footnote
    Select that word
    In the Style drawer click on the triangle for the Footnote in the paragraph style section. You have to move the cursor to the left to see the trinagle
    Choose Redefine style from the selection

  • How can i format my external hard drive to write files from Mac without loosing the files that i alredy have on my external hard when i used it with windows?

    How can i format my external hard drive to write files from Mac without loosing the files that i alredy have on my external hard when i used it with windows?
    I have been using Windows to write files to my 1TB WD external hard drive and I do not want to format to loose the files capacity of around 500GB
    Someone, Please help

    Hi Allen,
    Is there any way to store the back up to Mac and restore after formating?

  • How can a format an external hard drive to Fat 32 format

    how can i format an external hard drive to a Fat 32

    Drive Preparation
    1. Open Disk Utility in your Utilities folder.
    2. After DU loads select your hard drive (this is the entry with the mfgr.'s ID and size) from the left side list. Click on the Partition tab in the DU main window.
    3. Under the Volume Scheme heading set the number of partitions from the drop down menu to one. Click on the Options button, set the partition scheme to MBR then click on the OK button. Set the format type to MSDOS (FAT)  Click on the Partition button and wait until the process has completed.

  • HT1338 How can I format my hard drive without installation disk?

    Guys I am using Mac with OS X 10.6.5. How can I format hard drive without the installation disk?
    I don't have a installation disk can I buy one? where?

    Call Apple Sales at 1-800-692-7753 to order 10.6.
    Posts concerning 10.6 should be made in 10.6 usage forum.
    You posted in the 10.3 and down forum which is very old OSX software.
    DALE

  • How can I format a field in the form creator?

    How can I format a field in the form creator? It's putting the same text in all the fields within a table. I want each field within the table to have different text. As soon as you click out of the table, all the text is the same.
    I even changed the fields from a text box to a drop-down list so a person can make their selection, which will be a quantity from 0-9. There are two of these such fields. You make your selection in each, click off the table and both fields show whatever I selected in field 1. The original Qty I selected in the bottom field was a 5 but it changed it to whatever is in the top field on it's own. I've added a screen shot.

    This behaviors usually happens when you create the fields but  a copy paste command from one of the fields. The copy paste command assumes that your intentions is to maintain a copy of the field in two separate locations (e.i, a form field  "company name" printed in each and every page of a multi-page form document.
    Go to the properties fields of each field and make sure  to assign unique form field  names.

  • How can i Flash and restore the firmware ( EFI ) from a Macbook pro ( late 2008 , 5.1 ) ??

    How can i Flash and restore the firmware ( EFI ) from a Macbook pro ( late 2008 , 5.1 ) ??
    Please help me !!

    The Seagate backup drive I bought doesn't support 10.5.8
    The only reason I can see for that is it's formatted NTFS, which would likely be Read Only in 10.5.x, if you can reformat it MacOS extended, which would erase everything on it now, then that should work for your purposes.

  • How can I address and print an envelop from a letter created in Pages 09?

    How can I address and print an envelop from a letter created in Pages 09?

    You can copy & paste the address from the letter into a document formatted to envelope size. I prefer to use the EasyEnvelopes widget. If you have copied an address to the clipboard, it will automatically be added to the widget.

  • How can I move and scale my photos

    How can I move and scale my photos so that I can use them for wallpaper?  After update, I'm no longer able to do this as much as I need to.  They just pop back to their original size or larger.

    You will either need to turn Settings > General > Accessibility > Reduce Motion 'on', or create a higher resolution versions of your images
    From http://support.apple.com/kb/HT5595 :
    When the parallax effect is on, you may notice the following:
    Wallpaper, icons, and alerts shift slightly as you move your phone.
    When you set a wallpaper in Settings > Wallpapers & Brightness, the photo or image will be slightly zoomed and can't be scaled to fit the screen.
    If you zoom in, you will need to rescale your wallpaper to fit to the screen. You can't rescale certain photo formats, including landscape or square images.

Maybe you are looking for