bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] I broke a disk using parted, so now parted crashes when using


From: Peter Maloney
Subject: Re: [BUG] I broke a disk using parted, so now parted crashes when using the disk
Date: Wed, 31 Oct 2012 10:53:37 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0

Forgot to include version.

peter:/mnt # parted -v
parted (GNU parted) 2.4
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by
<http://git.debian.org/?p=parted/parted.git;a=blob_plain;f=AUTHORS>.


And just to prove my disk works fine:

peter:/mnt # dd if=/dev/zero of=/dev/sdb bs=1M count=200
200+0 records in
200+0 records out
209715200 bytes (210 MB) copied, 1.43544 s, 146 MB/s
peter:/mnt # parted /dev/sdb mktable gpt
Information: You may need to update /etc/fstab.                          

peter:/mnt # parted /dev/sdb unit s mkpart empty3TB 2048
$((2048+500*1000*1000*1000/512))
Information: You may need to update /etc/fstab.                          

peter:/mnt # parted /dev/sdb unit s print
Model: ATA Hitachi HDS72303 (scsi)
Disk /dev/sdb: 5860533168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End         Size        File system  Name      Flags
 1      2048s  976564548s  976562501s               empty3TB

peter:/mnt # parted /dev/sdb unit GB print
Model: ATA Hitachi HDS72303 (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End    Size   File system  Name      Flags
 1      0.00GB  500GB  500GB               empty3TB



Is there a parted syntax for what I did there in the $((...))? It is
very annoying to have to calculate it every time.
In FreeBSD, you can simply write in your alignment and size, and it does
the rest for you:    gpart create -a 2048 -s 500g -t $fstype $device


On 2012-10-31 10:49, Peter Maloney wrote:
> Messed up parted somehow.
>
>
> peter:/mnt # parted /dev/sdb unit s print
> Model: ATA Hitachi HDS72303 (scsi)
> Disk /dev/sdb: 5860533168s
> Sector size (logical/physical): 512B/512B
> Partition Table: gpt
>
> Number  Start    End          Size         File system  Name     Flags
>  1      124928s  5860532223s  5860407296s  ext3         cc-vds2
>
> peter:/mnt # wipefs -a /dev/sdb1
> 2 bytes were erased at offset 0x438 (ext3)
> they were: 53 ef
> peter:/mnt # wipefs -a /dev/sdb1
> peter:/mnt # parted /dev/sdb unit s rm 1
> Information: You may need to update /etc/fstab.                           
>
> peter:/mnt # parted /dev/sdb unit s mkpart empty3TB 2048 -- -1
> Warning: You requested a partition from 2048s to 5860533167s.             
> The closest location we can manage is 2048s to 5860533134s.
> Is this still acceptable to you?
> Yes/No? yes                                                               
> Information: You may need to update /etc/fstab.                           
>
> peter:/mnt # parted /dev/sdb unit s rm 1
> Information: You may need to update /etc/fstab.                           
>
> peter:/mnt # parted /dev/sdb unit s mkpart empty3TB 2048 +500GB
> Error: Invalid number.                                                    
> peter:/mnt # parted /dev/sdb unit s mkpart empty3TB 2048 +500
> Error: Invalid number.                                                    
> peter:/mnt # parted /dev/sdb unit s mkpart empty3TB 2048 -- +500
> Error: Invalid number.                                                    
> peter:/mnt # parted /dev/sdb unit s mkpart empty3TB 2048 2048+500GB
> Information: You may need to update /etc/fstab.                           
>
> peter:/mnt # parted /dev/sdb unit s print
> Backtrace has 13 calls on stack:
>   13: /usr/lib64/libparted.so.0(ped_assert+0x2e) [0x7fb751212a6e]
>   12: /usr/lib64/libparted.so.0(ped_geometry_read+0x80) [0x7fb75121a1e0]
>   11: /usr/lib64/libparted.so.0(ped_geometry_read_alloc+0x54)
> [0x7fb75121a274]
>   10: /usr/lib64/libparted.so.0(nilfs2_probe+0x6a) [0x7fb75123a5fa]
>   9: /usr/lib64/libparted.so.0(ped_file_system_probe_specific+0x53)
> [0x7fb751213f33]
>   8: /usr/lib64/libparted.so.0(ped_file_system_probe+0x52) [0x7fb751214012]
>   7: /usr/lib64/libparted.so.0(+0x435ac) [0x7fb7512425ac]
>   6: /usr/lib64/libparted.so.0(ped_disk_new+0x58) [0x7fb751218e68]
>   5: parted() [0x407a21]
>   4: parted(non_interactive_mode+0x8c) [0x40e78c]
>   3: parted(main+0x140f) [0x406daf]
>   2: /lib64/libc.so.6(__libc_start_main+0xed) [0x7fb7509ed23d]
>   1: parted() [0x406e79]
> Aborted
> peter:/mnt # parted /dev/sdb unit s rm 1
> Backtrace has 13 calls on stack:
>   13: /usr/lib64/libparted.so.0(ped_assert+0x2e) [0x7f839bccaa6e]
>   12: /usr/lib64/libparted.so.0(ped_geometry_read+0x80) [0x7f839bcd21e0]
>   11: /usr/lib64/libparted.so.0(ped_geometry_read_alloc+0x54)
> [0x7f839bcd2274]
>   10: /usr/lib64/libparted.so.0(nilfs2_probe+0x6a) [0x7f839bcf25fa]
>   9: /usr/lib64/libparted.so.0(ped_file_system_probe_specific+0x53)
> [0x7f839bccbf33]
>   8: /usr/lib64/libparted.so.0(ped_file_system_probe+0x52) [0x7f839bccc012]
>   7: /usr/lib64/libparted.so.0(+0x435ac) [0x7f839bcfa5ac]
>   6: /usr/lib64/libparted.so.0(ped_disk_new+0x58) [0x7f839bcd0e68]
>   5: parted() [0x408b4a]
>   4: parted(non_interactive_mode+0x8c) [0x40e78c]
>   3: parted(main+0x140f) [0x406daf]
>   2: /lib64/libc.so.6(__libc_start_main+0xed) [0x7f839b4a523d]
>   1: parted() [0x406e79]
> Aborted
> peter:/mnt # ls /dev/sdb*
> /dev/sdb  /dev/sdb1
>
>
> peter:/mnt # dd if=/dev/sdb bs=512 count=20 2>/dev/null | hexdump -C
> 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 
> |................|
> *
> 000001c0  01 00 ee fe ff ff 01 00  00 00 ff ff ff ff 00 00 
> |................|
> 000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 
> |................|
> *
> 000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa 
> |..............U.|
> 00000200  45 46 49 20 50 41 52 54  00 00 01 00 5c 00 00 00  |EFI
> PART....\...|
> 00000210  4c 86 14 12 00 00 00 00  01 00 00 00 00 00 00 00 
> |L...............|
> 00000220  af a3 50 5d 01 00 00 00  22 00 00 00 00 00 00 00 
> |..P]....".......|
> 00000230  8e a3 50 5d 01 00 00 00  d2 d1 56 6b 33 5c f5 43 
> |..P]......Vk3\.C|
> 00000240  a5 3e ee 40 1a b6 e4 94  02 00 00 00 00 00 00 00 
> |.>address@hidden|
> 00000250  80 00 00 00 80 00 00 00  d1 ef c0 bd 00 00 00 00 
> |................|
> 00000260  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 
> |................|
> *
> 00000400  a2 a0 d0 eb e5 b9 33 44  87 c0 68 b6 b7 26 99 c7 
> |......3D..h..&..|
> 00000410  44 c4 e6 c5 87 18 c9 49  bd 5c b9 3e 27 8f 10 bc 
> |D......I.\.>'...|
> 00000420  00 08 00 00 00 00 00 00  00 08 00 00 00 00 00 00 
> |................|
> 00000430  00 00 00 00 00 00 00 00  65 00 6d 00 70 00 74 00 
> |........e.m.p.t.|
> 00000440  79 00 33 00 54 00 42 00  00 00 00 00 00 00 00 00 
> |y.3.T.B.........|
> 00000450  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 
> |................|
> *
> 00002800
>


-- 

--------------------------------------------
Peter Maloney
Brockmann Consult
Max-Planck-Str. 2
21502 Geesthacht
Germany
Tel: +49 4152 889 300
Fax: +49 4152 889 333
E-mail: address@hidden
Internet: http://www.brockmann-consult.de
--------------------------------------------




reply via email to

[Prev in Thread] Current Thread [Next in Thread]