Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Partitioning woes
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Partitioning woes

DroidzoneDroidzone Member
edited June 2015 in Help

I tried repartitioning the disk on a kimsufi because I inadvertently didnt create enough space for the root partition.

I tried the following:

#parted
Partition Table: msdos
Number  Start   End     Size    Type     File system     Flags
 1      2097kB  21.0GB  21.0GB  primary  ext4            boot
 2      21.0GB  500GB   479GB   primary  ext4
 3      500GB   500GB   536MB   primary  linux-swap(v1)

(parted) rm 2
(parted) mkpart
Partition type?  primary/extended? primary
File system type?  [ext2]? ext4
Start? 41GB
End? 500GB
(parted) q
Information: You may need to update /etc/fstab.

#resize2fs /dev/sda2
resize2fs 1.42.5 (29-Jul-2012)
resize2fs: Bad magic number in super-block while trying to open /dev/sda2
Couldn't find valid filesystem superblock.
fdisk list before operation:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        4096    40962047    20478976   83  Linux
/dev/sda2        40962048   975718399   467378176   83  Linux
/dev/sda3       975718400   976764927      523264   82  Linux swap / Solaris

Now fdisk shows:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        4096    40962047    20478976   83  Linux
/dev/sda2        80078848   975718399   447819776   83  Linux
/dev/sda3       975718400   976764927      523264   82  Linux swap / Solaris

Unfortunately I cant seem to find why resizefs reports that Couldn't find valid filesystem superblock.

The OS is Debian wheezy.

Comments

  • ClouviderClouvider Member, Patron Provider

    Because you've removed the partition, hence there is no superblock.

    https://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-disk-storage.html

  • DroidzoneDroidzone Member
    edited June 2015

    Clouvider said: Because you've removed the partition, hence there is no superblock.

    Thank you for responding.
    I deleted it, and created it again (to resize). My version of gnu parted doesnt seem to have a resize command. What I cant understand it is, if I do it like this:

    (parted) rm 2
    (parted) mkpart primary ext4 21.0GB 500GBp
    (parted) p
    Model: ATA TOSHIBA DT01ACA0 (scsi)
    Disk /dev/sda: 500GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: msdos
    Disk Flags:
    
    Number  Start   End     Size    Type     File system     Flags
     1      2097kB  21.0GB  21.0GB  primary  ext4            boot
     2      21.0GB  500GB   479GB   primary  **ext4**
     3      500GB   500GB   536MB   primary  linux-swap(v1)
    

    The above creates the partition fine.

    But if I change the start to 41GB, like this:

    (parted) rm 2
    (parted) mkpart primary ext4 41.0GB 500GB
    (parted) p
    Model: ATA TOSHIBA DT01ACA0 (scsi)
    Disk /dev/sda: 500GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: msdos
    Disk Flags:
    
    Number  Start   End     Size    Type     File system     Flags
     1      2097kB  21.0GB  21.0GB  primary  ext4            boot
     2      **41.0GB  500GB   459GB   primary**
     3      500GB   500GB   536MB   primary  linux-swap(v1)
    

    It doesnt work. See that the file system does not show 'ext4'.

  • ClouviderClouvider Member, Patron Provider

    Superblock is still in the same place. When you move the start position of the partition it is simply left behind, hence you have no superblock in your new range.

    I would suggest to clone the partition in question (or dump an image), create it at the new location and then restore.

    Some guide that explains it can be found here: https://help.ubuntu.com/community/MovingLinuxPartition

    Thanked by 1Droidzone
  • SpiritSpirit Member

    Flagged as resolved by thread starter.

This discussion has been closed.