Announcement

Collapse
No announcement yet.

Can't format ext3 partition: deleted inode referenced

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can't format ext3 partition: deleted inode referenced

    Hi!

    On my previous config, i had 4 primary partitions on my 120 GB SSD:

    sda1 - 100MiB win7 boot
    sda2 - ~80GiB win7 C:\
    sda3 - ~5 GiB ext4 mounted on /
    sda4 - ~ 20 GiB ext4, /home

    I rad out of space on sda3 ( / ) and couldn't even get a graphical interface, only commandline. I reduced sda2 booting windows, then tried to boot linux to expand sda3 somehow. The only partition manager i know via commandline is fdisk. In "extra functionality", fdisk offers "move beginning of data in a partition". I thought that was what i wanted, so i did it. Result: couldn't boot. Not Windows, not kubuntu. Just a grub rescue commandline wich i didn't know how to use.

    I tried to reinstall kubuntu, as i knew for sure the windows partitions were OK. When installing kubuntu, it throwed an error when triying to format sda3 (partitioning was not altered).

    I finally tried booting the liveCD from a usb drive. I don't know why, i can't log in there with a graphical interface; it asks me for a user and pass, wich is odd because it's a usb flash drive :/

    Anyway, i can get a commandline from the live usb drive. i re-partitioned, and i _can_ format any partition with ntfs filesystem without a problem. However, the moment i try to format any partition with a ext3 or ext4 filseystem, no matter the size or position of the partition, it showsfollowing error:

    Please note all codes are being copied by hand, there might be any mistakes on my copying.
    Code:
    root@ubuntu:~# mkfs.ext3 /dev/sda1
    mke2fs 1.41.14 (22-Dec-2010)
    [7712.353892] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 82954 
    ext2fs_check_if_mount: Input/output error while determinig wether /dev/sda1 is mounted      # it is _not_ mounted
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Sride=0 blocks, Stripe width=0 blocks
    7331840 inodes, 29304950 blocks
    1465247 blocks (5.00%) reserved forthe super user
    First data block=0
    Maximum filesystem blocks= 4294967296
    895 block groups
    32768 blocks per group, 32768 fragments per group
    8192 inodes per group
    Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        409600, 7962624, 11239424, 20480000, 23887872
    
    Writing inode tables: done
    Creating journal (32768 blocks): [ 7759681593] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 82954
    mkfs.ext3: Input/output error
        while trying to create journal
    If I try to make a ext2 filesystem, it shows the same ext2_lookup error, but it seems to format correctly:

    Code:
    root@ubuntu:~# mkfs.ext2 /dev/sda1             #now creating ext2
    mke2fs 1.41.14 (22-Dec-2010)
    [8242.944246] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 82954 
    ext2fs_check_if_mount: Input/output error while determinig wether /dev/sda1 is mounted      #again, it isn't mounted
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Sride=0 blocks, Stripe width=0 blocks
    7331840 inodes, 29304950 blocks
    1465247 blocks (5.00%) reserved forthe super user
    First data block=0
    Maximum filesystem blocks= 4294967296
    895 block groups
    32768 blocks per group, 32768 fragments per group
    8192 inodes per group
    Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        409600, 7962624, 11239424, 20480000, 23887872
    
    Writing inode tables: done
    Writing superblocks and filesystem accounting information: done
    
    this filesystem will be automatically checked every 265 mounts or
    180 days, wichever comes first. Use tune2fs -c or -i to override.
    When formatted as ext2, if I do a fsck /dev/sda1:

    Code:
    root@ubuntu:~# fsck /dev/sda1
    fsck from util-linux 2.19.1
    e2fsck 1.41.14 (22-Dec-2010)
    [ 8553.966728] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 82954
    ext2fs_check_if_mount: Input/output error while determining whether /dev/sda1 is mounted. 
    /dev/sda1: clean, 11/7331840 files, 475411/29304950 blocks
    After "mkfs.ext3 /dev/sda1":

    Code:
    root@ubuntu:~#fsck /dev/sda1 -y
    
    # THIS PRODUCED A VERY LONG OUTPUT
    
    /dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****
    /dev/sda1: 11/7331840 files (0.0% non-contiguous), 475411/2930450 blocks
    Code:
    root@ubuntu:~# fsck -t ext3 /dev/sda1 -p
    fsck from util-linux 2.19.1
    [9721.167884] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 82954
    ext2fs_check_if_mount: Input/output error while determining wether /dev/da1 is mounted.
    fsck.ext2: bad magic number in super-block while trying to open /dev/sda1       # what??
    /dev/sda1:
    The superblock could not be read or does not describe a correct ext2
    filesystem. If the device is valid and it really contains an ext2
    filesystem (and not swap or ufs or something else), then the superblock 
    is corrupt, and you might try running e2fsck with an alternate superblock:
      e2fsck -b 8193 <device>
    Ok, i've nothing to lose, let's try that:

    Code:
    root@ubuntu:~# e2fsck -b 8193 /dev/sda1
    e2fsck 1.41.14 (22-Dec-2010)
    [10332.205798] EXT2-fs (loop1): error: ext2_lookup: deleted inode referenced: 82954
    ext2fs_check_if_mount: Input/output error while determining wether /dev/sda1 is mounted.
    e2fsck: Back magic number in superblock while trying to open /dev/sda1
    
    The superblock could not be read or does not describe a correct ext2
    filesystem. If the device is valid and it really contains an ext2
    filesystem (and not swap or ufs or something else), then the superblock 
    is corrupt, and you might try running e2fsck with an alternate superblock:
      e2fsck -b 8193 <device>
    Great, a loop. This is when I realised i needed help.

    I'm not very sure on how ext3 works, but there's definetly some problem with inode reference 82954, wich maybe was caused due to the fdisk command "move beginning of data in a partition". When i thought about this, i searched to completely wipe the drive. I used the command:

    Code:
    hdparm --security-erase NULL /dev/sda
    But nothing changed.

    Please give me some advice on exactly what is the problem and, if possible, how to solve it.

    Thanks ind advance.


    #2
    Re: Can't format ext3 partition: deleted inode referenced

    Originally posted by cabanur
    I reduced sda2 booting windows, then tried to boot linux to expand sda3 somehow. The only partition manager i know via commandline is fdisk.
    That's a no-no. You don't ever try to adjust a mounted partition, and that's exactly what you did. You changed the MBR and /dev/sda3 was actually in use at the time.

    I dunno if you can fix it while preserving the Win 7 installation or not -- maybe testdisk or Hirens boot CD has something that will help you. For future adventures, do yourself a favor and make a Parted Magic Live CD or USB stick.

    http://partedmagic.com/doku.php?id=downloads

    Comment


      #3
      Re: Can't format ext3 partition: deleted inode referenced

      Originally posted by dibl
      That's a no-no. You don't ever try to adjust a mounted partition, and that's exactly what you did. You changed the MBR and /dev/sda3 was actually in use at the time.

      I dunno if you can fix it while preserving the Win 7 installation or not -- maybe testdisk or Hirens boot CD has something that will help you. For future adventures, do yourself a favor and make a Parted Magic Live CD or USB stick.

      http://partedmagic.com/doku.php?id=downloads
      I actually reduced /dev/sda2 (windows c while on windows (i thought it was odd that he let me), but when i adjusted /dev/sda3, i did it from a liveCD (usb flash).

      I could install and boot win7 with no problems at all, so i don't think the MBR is screwed.

      Thanks for answering =)

      Comment


        #4
        Re: Can't format ext3 partition: deleted inode referenced

        Win 7 has a disk management tool that will allow you to adjust the size of NTFS partitions while running Win 7, and that is actually the recommended way to change the Windows partition size prior to installing Linux on the same drive. I thought you said you used fdisk to change partition boundaries of an adjacent partition, from a running Linux OS. That would be a bad thing to do and probably cause all kinds of trouble.

        I dunno exactly what's wrong there, but the MBR table has apparently been modified in a bad way. If it were me, I'd try something like this:

        Boot my Parted Magic USB stick, and use the partition copy command to copy exactly the first three partitions to another empty/dd'd hard drive. Then I would dd the original drive to clear the boot sector and everything, and then I would first copy back the first three partitions, and finally I would make a new fourth partition, and designate it an Extended partition type, and within that I would make my Linux OS partition, and a swap partition, as a minimum, and another partition for /home if I wanted that separate.

        After having done that, you should be able to install Linux, including swap and /home, on the logical partitions, and when installing grub on the hard drive MBR, it should pick up the Win 7 OS on the third primary partition.

        Comment


          #5
          Re: Can't format ext3 partition: deleted inode referenced


          I lost all data long ago xD, but it isn't really important, as I have all important things stored in another computer.

          Originally posted by dibl
          Then I would dd the original drive to clear the boot sector and everything, and then I would first copy back the first three partitions, and finally I would make a new fourth partition, and designate it an Extended partition type, and within that I would make my Linux OS partition, and a swap partition, as a minimum, and another partition for /home if I wanted that separate.
          I'm sorry, my english is not that good. What does "dd" mean (from "i would dd the original drive")?

          Right now I used the win7 cd's command line and repartitioned and formatted the drive with "diskpart".

          I'll try again now with the config i want, wich is the same as i had at the beginning of all (i don't need a 5th partition, as this pc has 8GiB RAM so I really don't need swap) with 4 primary partitions.

          If after formatting with diskpart it still won't work, i'll use Parted Magic as you recommended. I've never used this tool before, i hope it's not very complicated =)

          Either if i manage to get things right or not, i'll let you know

          Thanks!

          Comment


            #6
            Re: Can't format ext3 partition: deleted inode referenced

            Okayyy, it worked

            Aparently whatever the problem was with the disc, formatting with "DISKPART" worked. Also, i didn't trust my usb flash drive because it didn't let me start a graphical live session, so i used unetbootin to download and burn it again. I partitioned and formatted from konsole, now it's installing normally.

            I guess when i install windows later it will mess up grub, so i'll have to fix that later, never minds.

            dibl, thanks a lot for your help

            Comment


              #7
              Re: Can't format ext3 partition: deleted inode referenced

              Great!

              For future reference: http://kubuntuforums.net/forums/inde...opic=3090824.0

              In particular, for a hard drive that needs the boot sector zeroized:

              Code:
              dd if=/dev/zero of=/dev/sdx bs=512 count=1
              where "x" is your designated hard disk drive.

              Comment

              Working...
              X