Re: script inutilisable ( GPT + pas de partition valable ??)
On Thu, 3 Nov 2016 14:00:48 +0100
pat G <patgsiosisr@gmail.com> wrote:
> Bonjour,
>
> dans un script je veux vérifier la présence d'un disque (et sa
> première partition), mais ça indique pleins de choses qui
> normalement/habituellement ne s'affichent pas (malgré le grep), du
> coup mon script ne peut pas continuer à faire son travail habituel.
>
> ######
>
> fdisk -l |grep sdf1 |awk '{print $1}'
>
> Attention : identifiant de table de partitions GPT (GUID) détecté sur
> « /dev/sdc » ! L'utilitaire sfdisk ne prend pas GPT en charge.
> Utilisez GNU Parted.
>
> Attention : identifiant de table de partitions GPT (GUID) détecté sur
> « /dev/sdb » ! L'utilitaire sfdisk ne prend pas GPT en charge.
> Utilisez GNU Parted.
>
> Attention : identifiant de table de partitions GPT (GUID) détecté sur
> « /dev/sdd » ! L'utilitaire sfdisk ne prend pas GPT en charge.
> Utilisez GNU Parted.
>
> Attention : identifiant de table de partitions GPT (GUID) détecté sur
> « /dev/sda » ! L'utilitaire sfdisk ne prend pas GPT en charge.
> Utilisez GNU Parted.
>
> Le disque /dev/md0 ne contient pas une table de partitions valable
> Le disque /dev/md1 ne contient pas une table de partitions valable
> Le disque /dev/md2 ne contient pas une table de partitions valable
> Le disque /dev/md3 ne contient pas une table de partitions valable
> /dev/sdf1
> ######
>
> Quelqu'un saurait ce qui peut provoquer ce bug ? je vois bien une
> histoire de GPT et le fait que le raid ne contient pas une table de
> partitions valable, et pourtant...
>
> lorsque je fais un print all dans parted, ça m'indique ceci :
>
> ######
>
> print all
> Model: ATA WDC WD30EZRX-00D (scsi)
> Disk /dev/sda: 3001GB
> Sector size (logical/physical): 512B/4096B
> Partition Table: gpt
>
> Number Start End Size File system Name Flags
> 1 1049kB 105MB 104MB bios_grub
> 2 105MB 315MB 210MB ext2 boot
> 3 315MB 3459MB 3145MB linux-swap(v1) raid
> 4 3459MB 29,7GB 26,2GB ext4 raid
> 5 29,7GB 55,9GB 26,2GB ext4 raid
> 6 55,9GB 3001GB 2945GB ext4 raid
>
>
> Model: ATA WDC WD30EZRX-00D (scsi)
> Disk /dev/sdb: 3001GB
> Sector size (logical/physical): 512B/4096B
> Partition Table: gpt
>
> Number Start End Size File system Name Flags
> 2 1049kB 106MB 105MB bios_grub
> 1 106MB 316MB 210MB ext2 boot
> 3 316MB 3461MB 3146MB linux-swap(v1) raid
> 4 3461MB 29,7GB 26,2GB ext4 raid
> 5 29,7GB 55,9GB 26,2GB ext4 raid
> 6 55,9GB 3001GB 2945GB ext4 raid
>
>
> Model: ATA WDC WD30EZRX-00D (scsi)
> Disk /dev/sdc: 3001GB
> Sector size (logical/physical): 512B/4096B
> Partition Table: gpt
>
> Number Start End Size File system Name Flags
> 1 1049kB 106MB 105MB bios_grub
> 2 106MB 316MB 210MB ext2 boot
> 3 316MB 3461MB 3146MB linux-swap(v1) raid
> 4 3461MB 29,7GB 26,2GB ext4 raid
> 5 29,7GB 55,9GB 26,2GB ext4 raid
> 6 55,9GB 3001GB 2945GB ext4 raid
>
>
> Model: ATA WDC WD30EZRX-00D (scsi)
> Disk /dev/sdd: 3001GB
> Sector size (logical/physical): 512B/4096B
> Partition Table: gpt
>
> Number Start End Size File system Name Flags
> 1 1049kB 105MB 104MB bios_grub
> 2 105MB 315MB 210MB ext2 boot
> 3 315MB 3459MB 3145MB linux-swap(v1) raid
> 4 3459MB 29,7GB 26,2GB ext4 raid
> 5 29,7GB 55,9GB 26,2GB ext4 raid
> 6 55,9GB 3001GB 2945GB ext4 raid
>
>
> Model: WD My Book 1170 (scsi)
> Disk /dev/sdf: 3001GB
> Sector size (logical/physical): 4096B/4096B
> Partition Table: msdos
>
> Number Start End Size Type File system Flags
> 1 1049kB 3001GB 3001GB primary
>
>
> Model: Linux Software RAID Array (md)
> Disk /dev/md0: 9426MB
> Sector size (logical/physical): 512B/4096B
> Partition Table: loop
>
> Number Start End Size File system Flags
> 1 0,00B 9426MB 9426MB linux-swap(v1)
>
>
> Model: Linux Software RAID Array (md)
> Disk /dev/md1: 78,6GB
> Sector size (logical/physical): 512B/4096B
> Partition Table: loop
>
> Number Start End Size File system Flags
> 1 0,00B 78,6GB 78,6GB ext4
>
>
> Model: Linux Software RAID Array (md)
> Disk /dev/md2: 78,6GB
> Sector size (logical/physical): 512B/4096B
> Partition Table: loop
>
> Number Start End Size File system Flags
> 1 0,00B 78,6GB 78,6GB ext4
>
>
> Model: Linux Software RAID Array (md)
> Disk /dev/md3: 8834GB
> Sector size (logical/physical): 512B/4096B
> Partition Table: loop
>
> Number Start End Size File system Flags
> 1 0,00B 8834GB 8834GB ext4
> ######
>
> y aurait-il une piste pour régler ce genre de problème ?
>
> PatG
>
bonjour,
serait il possible de remplacer :
fdisk -l |grep sdf1 |awk '{print $1}'
par
sfdisk -l | awk '/sdf1/ {print $1}'
slt
bernard
--
bernard schoenacker <bernard.schoenacker@free.fr>
Reply to: