Re: [CentOS] Problem resizing partition of nfs volume

2010-08-12 Thread John R Pierce
  On 08/12/10 2:56 PM, Dan Yamins wrote:
 Hi:

 I have an NFS volume that I'm trying to resize a partition on.

 Something about the fdisk process is corrupting something on the drive

 Before running fdisk, I can mount the volume find:

 $ mount /dev/sdo1 /home

 ... and the volume is mounted fine.

 And,
 $ e2fsck -f /dev/sdo1
 /dev/sdo1: clean, ...


 But then I run fdisk to rewrite the partition table of this drive, to 
 expand the /dev/sdo1 partition w/o losing data:

 $ fdisk /dev/sdo
 # Type 'd' to delete the primary partition
 # Type 'n' for new partition
 # Type 'p' for primary
 # Type '1' for 1st
 # Type Enter for 1st cylinder
 # Type Enter for last cylinder (full disk)
 # Type 'w' to finish

 Calling ioctl() ...
 Syncing disks ...

 But then something has gone wrong.

 $ e2fsck -f /dev/sdo1
 e2fsck 1.39 (29-May-2006)
 Couldn't find ext2 superblock, trying backup blocks...
 e2fsck: Bad magic number in super-block while trying to open /dev/sdm1 ...


 And I can't mount the volume any more:
 $ mount /dev/sdo1 /home
 mount: you must specify the filesystem type

 What am I doing wrong? Am I missing a step of the process?

yeah, you deleted your file system, then created a new empty partition.

instead, you should have used parted(8) or similar to expand the 
partition, then used resize2fs(8) to expand the file system on this 
partition to its new size.

me, I'd strongly suggest doing a full backup of the partition first with 
dump(8)


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Problem resizing partition of nfs volume

2010-08-12 Thread David Véjar
cuak

David Véjar

Soporte y Redes

 

Ferretería Santiago

Soluciones de Abastecimiento

Lira 919 Santiago, Chile

Fono: (56 2) 731 3824

 

www.ferreteriasantiago.cl

-Mensaje original-
De: centos-boun...@centos.org [mailto:centos-boun...@centos.org] En nombre
de John R Pierce
Enviado el: jueves, 12 de agosto de 2010 18:22
Para: CentOS mailing list
Asunto: Re: [CentOS] Problem resizing partition of nfs volume

  On 08/12/10 2:56 PM, Dan Yamins wrote:
 Hi:

 I have an NFS volume that I'm trying to resize a partition on.

 Something about the fdisk process is corrupting something on the drive

 Before running fdisk, I can mount the volume find:

 $ mount /dev/sdo1 /home

 ... and the volume is mounted fine.

 And,
 $ e2fsck -f /dev/sdo1
 /dev/sdo1: clean, ...


 But then I run fdisk to rewrite the partition table of this drive, to 
 expand the /dev/sdo1 partition w/o losing data:

 $ fdisk /dev/sdo
 # Type 'd' to delete the primary partition
 # Type 'n' for new partition
 # Type 'p' for primary
 # Type '1' for 1st
 # Type Enter for 1st cylinder
 # Type Enter for last cylinder (full disk)
 # Type 'w' to finish

 Calling ioctl() ...
 Syncing disks ...

 But then something has gone wrong.

 $ e2fsck -f /dev/sdo1
 e2fsck 1.39 (29-May-2006)
 Couldn't find ext2 superblock, trying backup blocks...
 e2fsck: Bad magic number in super-block while trying to open /dev/sdm1 ...


 And I can't mount the volume any more:
 $ mount /dev/sdo1 /home
 mount: you must specify the filesystem type

 What am I doing wrong? Am I missing a step of the process?

yeah, you deleted your file system, then created a new empty partition.

instead, you should have used parted(8) or similar to expand the 
partition, then used resize2fs(8) to expand the file system on this 
partition to its new size.

me, I'd strongly suggest doing a full backup of the partition first with 
dump(8)


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Problem resizing partition of nfs volume

2010-08-12 Thread Dan Yamins
On Thu, Aug 12, 2010 at 6:21 PM, John R Pierce pie...@hogranch.com wrote:

  On 08/12/10 2:56 PM, Dan Yamins wrote:
  Hi:
 
  I have an NFS volume that I'm trying to resize a partition on.
 
  Something about the fdisk process is corrupting something on the drive
 
  Before running fdisk, I can mount the volume find:
 
  $ mount /dev/sdo1 /home
 
  ... and the volume is mounted fine.
 
  And,
  $ e2fsck -f /dev/sdo1
  /dev/sdo1: clean, ...
 
 
  But then I run fdisk to rewrite the partition table of this drive, to
  expand the /dev/sdo1 partition w/o losing data:
 
  $ fdisk /dev/sdo
  # Type 'd' to delete the primary partition
  # Type 'n' for new partition
  # Type 'p' for primary
  # Type '1' for 1st
  # Type Enter for 1st cylinder
  # Type Enter for last cylinder (full disk)
  # Type 'w' to finish
 
  Calling ioctl() ...
  Syncing disks ...
 
  But then something has gone wrong.
 
  $ e2fsck -f /dev/sdo1
  e2fsck 1.39 (29-May-2006)
  Couldn't find ext2 superblock, trying backup blocks...
  e2fsck: Bad magic number in super-block while trying to open /dev/sdm1
 ...
 
 
  And I can't mount the volume any more:
  $ mount /dev/sdo1 /home
  mount: you must specify the filesystem type
 
  What am I doing wrong? Am I missing a step of the process?

 yeah, you deleted your file system, then created a new empty partition.


Luckily I'm doing this via snapshots of an amazon EBS volume ... so this
whole thing was done on throw-away-able backup volume, which can be
recreated from the original volume at any time.   I've just done this, and
I've attached the newly-created volume to /dev/sdo.

Now I'm trying to use parted.

[r...@domu-12-31-39-0e-b2-61 ~]# parted /dev/sdo
Error: Error initialising SCSI device /dev/sdo - Invalid argument

I _can_ do it on the volume path itself:

[r...@domu-12-31-39-0e-b2-61 ~]# parted /dev/sdo1
Using /dev/sdo1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)

.. but this seems wrong, since I'm trying to edit the partition table not of
the partition /dev/sdo1 but of the drive itself.  ... Or perhaps I should
this?  (If so, could you give more explicit instructions?)

Perhaps because this is a network attached drive, something virtual that
amazon provides.However, the reason I've written to the centOS list is
because the same procedure has worked fine with ubuntu images ... so it
didnt' seem like an amazon problem

Thanks!
Dan
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Problem resizing partition of nfs volume

2010-08-12 Thread Dan Yamins
On Thu, Aug 12, 2010 at 6:25 PM, David Véjar
dve...@ferreteriasantiago.clwrote:

 cuak



?



 -Mensaje original-
 De: centos-boun...@centos.org [mailto:centos-boun...@centos.org] En nombre
 de John R Pierce
 Enviado el: jueves, 12 de agosto de 2010 18:22
 Para: CentOS mailing list
 Asunto: Re: [CentOS] Problem resizing partition of nfs volume

  On 08/12/10 2:56 PM, Dan Yamins wrote:
  Hi:
 
  I have an NFS volume that I'm trying to resize a partition on.
 
  Something about the fdisk process is corrupting something on the drive
 
  Before running fdisk, I can mount the volume find:
 
  $ mount /dev/sdo1 /home
 
  ... and the volume is mounted fine.
 
  And,
  $ e2fsck -f /dev/sdo1
  /dev/sdo1: clean, ...
 
 
  But then I run fdisk to rewrite the partition table of this drive, to
  expand the /dev/sdo1 partition w/o losing data:
 
  $ fdisk /dev/sdo
  # Type 'd' to delete the primary partition
  # Type 'n' for new partition
  # Type 'p' for primary
  # Type '1' for 1st
  # Type Enter for 1st cylinder
  # Type Enter for last cylinder (full disk)
  # Type 'w' to finish
 
  Calling ioctl() ...
  Syncing disks ...
 
  But then something has gone wrong.
 
  $ e2fsck -f /dev/sdo1
  e2fsck 1.39 (29-May-2006)
  Couldn't find ext2 superblock, trying backup blocks...
  e2fsck: Bad magic number in super-block while trying to open /dev/sdm1
 ...
 
 
  And I can't mount the volume any more:
  $ mount /dev/sdo1 /home
  mount: you must specify the filesystem type
 
  What am I doing wrong? Am I missing a step of the process?

 yeah, you deleted your file system, then created a new empty partition.

 instead, you should have used parted(8) or similar to expand the
 partition, then used resize2fs(8) to expand the file system on this
 partition to its new size.

 me, I'd strongly suggest doing a full backup of the partition first with
 dump(8)


 ___
 CentOS mailing list
 CentOS@centos.org
 http://lists.centos.org/mailman/listinfo/centos

 ___
 CentOS mailing list
 CentOS@centos.org
 http://lists.centos.org/mailman/listinfo/centos

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Problem resizing partition of nfs volume

2010-08-12 Thread Dan Yamins
instead, you should have used parted(8) or similar to expand the
 partition, then used resize2fs(8) to expand the file system on this
 partition to its new size.


So I'm trying parted on a new, clean volume created from the snapshot,
attached to /dev/sdm  As I explained before, I can't do

$ parted /dev/sdm

[r...@domu-12-31-39-0e-b2-61 ~]# parted /dev/sdm
Error: Error initialising SCSI device /dev/sdm - Invalid argument


I *CAN* do parted on the path:

$ parted /dev/sdm1
GNU Parted 1.8.1
Using /dev/sdm1
Welcome to GNU Parted! Type 'help' to view a list of commands.

But then i get this error:

(parted) resize 1 0 500GB
Error: The location 500GB is outside of the device /dev/sdo1.

Which is course is true ...

(parted) print

Disk /dev/sdm1: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start   End SizeFile system  Flags
 1  0.00kB  21.5GB  21.5GB  ext3


So I'm not sure where to go from here...

thanks!
Dan
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Problem resizing partition of nfs volume

2010-08-12 Thread Yves Bellefeuille
On Thursday 12 August 2010 17:56, Dan Yamins wrote:

 I have an NFS volume that I'm trying to resize a partition on.

I suggest you try Parted Magic: http://partedmagic.com/

It doesn't do anything you can't do from the command line, but it's much 
easier to use.

-- 
Yves Bellefeuille y...@storm.ca 
Au Bellefeuille estas malkompetenta juristo au li estas malhonesta;
kaj ech tertium datur: ambau malvirtoj en unu homo. -- Heroldo
Komunikas, n-ro 447.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Problem resizing partition of nfs volume

2010-08-12 Thread Dan Yamins
I was just shown the solution to my problem, using the sfdisk program
instead of the fdisk or parted programs.Apparently parted could
not work because the drive is not really SCSI, and the fdisk program is to
incorrect and was overwriting a portion of the disk.   however, sfdisk
turns out to be more correct -- although more cumbersome to use.

Dan

On Thu, Aug 12, 2010 at 8:32 PM, Yves Bellefeuille y...@storm.ca wrote:

 On Thursday 12 August 2010 17:56, Dan Yamins wrote:

  I have an NFS volume that I'm trying to resize a partition on.

 I suggest you try Parted Magic: http://partedmagic.com/

 It doesn't do anything you can't do from the command line, but it's much
 easier to use.

 --
 Yves Bellefeuille y...@storm.ca
 Au Bellefeuille estas malkompetenta juristo au li estas malhonesta;
 kaj ech tertium datur: ambau malvirtoj en unu homo. -- Heroldo
 Komunikas, n-ro 447.
 ___
 CentOS mailing list
 CentOS@centos.org
 http://lists.centos.org/mailman/listinfo/centos

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos