Comandos de la terminal/parted

De WikiCabal
Saltar a: navegación, buscar

parted

[root@Llawyr mnt]# parted --help
Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]
Apply COMMANDs with PARAMETERS to DEVICE.  If no COMMAND(s) are given, run in
interactive mode.

OPTIONs:
  -h, --help                      displays this help message
  -l, --list                      lists partition layout on all block devices
  -m, --machine                   displays machine parseable output
  -s, --script                    never prompts for user intervention
  -v, --version                   displays the version
  -a, --align=[none|cyl|min|opt]  alignment for new partitions

COMMANDs:
  align-check TYPE N                        check partition N for TYPE(min|opt)
        alignment
  help [COMMAND]                           print general help, or help on
        COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition
        table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all|NUMBER]     display the partition table,
        available devices, free space, all found partitions, or a particular
        partition
  quit                                     exit program
  rescue START END                         rescue a lost partition near START
        and END
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected
        device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition
        NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and
        copyright information of GNU Parted

Report bugs to bug-parted@gnu.org

[root@Llawyr mnt]# parted --version
parted (GNU parted) 3.1
Packaged by mageia
Copyright (C) 2012 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>.

[root@Llawyr mnt]# parted -l
Model: ATA ST9500325AS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  2089MB  2088MB  primary  ext4            boot
 2      2090MB  17.8GB  15.7GB  primary  linux-swap(v1)
 4      17.8GB  65.0GB  47.2GB  primary  ext4
 3      65.0GB  500GB   435GB   primary  ext4


Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 8025MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name              Flags
 1      1049kB  1075MB  1074MB  xfs          Linux filesystem
 2      1075MB  2149MB  1074MB               Linux filesystem
 3      2149MB  3222MB  1074MB  ext4         Linux filesystem

[root@Llawyr mnt]# parted /dev/sdb print
Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 8025MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name              Flags
 1      1049kB  1075MB  1074MB  xfs          Linux filesystem
 2      1075MB  2149MB  1074MB               Linux filesystem
 3      2149MB  3222MB  1074MB  ext4         Linux filesystem

[root@Llawyr mnt]# parted /dev/sdb print free
Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 8025MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name              Flags
        17.4kB  1049kB  1031kB  Free Space
 1      1049kB  1075MB  1074MB  xfs          Linux filesystem
 2      1075MB  2149MB  1074MB               Linux filesystem
 3      2149MB  3222MB  1074MB  ext4         Linux filesystem
        3222MB  8025MB  4802MB  Free Space

[root@Llawyr mnt]# parted print list
Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 8025MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name              Flags
 1      1049kB  1075MB  1074MB  xfs          Linux filesystem
 2      1075MB  2149MB  1074MB               Linux filesystem
 3      2149MB  3222MB  1074MB  ext4         Linux filesystem


Model: ATA ST9500325AS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  2089MB  2088MB  primary  ext4            boot
 2      2090MB  17.8GB  15.7GB  primary  linux-swap(v1)
 4      17.8GB  65.0GB  47.2GB  primary  ext4
 3      65.0GB  500GB   435GB   primary  ext4


[root@Llawyr mnt]# parted  print devices
/dev/sdb (8025MB)
/dev/sda (500GB)

[root@Llawyr mnt]# parted /dev/sdb rm 3
Error: Partition /dev/sdb3 is being used. You must unmount it before you modify
it with Parted.

[root@Llawyr mnt]# umount /dev/sdb3                                       

[root@Llawyr mnt]# parted /dev/sdb rm 3
Information: You may need to update /etc/fstab.

[root@Llawyr mnt]# parted /dev/sdb print
Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 8025MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name              Flags
 1      1049kB  1075MB  1074MB  xfs          Linux filesystem
 2      1075MB  2149MB  1074MB               Linux filesystem

[root@Llawyr mnt]# parted /dev/sdb rescue
Start? 2149MB                                                             
End? 3222MB                                                               
Information: A ext4 primary partition was found at 2149MB -> 3222MB.  Do you
want to add it to the partition table?
Yes/No/Cancel? yes                                                        
Information: You may need to update /etc/fstab.

[root@Llawyr mnt]# parted /dev/sdb print                                 
Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 8025MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name              Flags
 1      1049kB  1075MB  1074MB  xfs          Linux filesystem
 2      1075MB  2149MB  1074MB               Linux filesystem
 3      2149MB  3222MB  1074MB  ext4

[root@Llawyr mnt]# mount -t auto /dev/sdb3 /mnt

[root@Llawyr mnt]# mount
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=6124048k,nr_inodes=1531012,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
 .
 .
 .
/dev/sda3 on /home type ext4 (rw,noatime,data=ordered)
/dev/sda1 on /boot type ext4 (rw,noatime,data=ordered)
/dev/sdb3 on /mnt type ext4 (rw,relatime,data=ordered)

[root@Llawyr mnt]# parted /dev/sdb print
Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 8025MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start  End  Size  Type  File system  Flags

[root@Llawyr mnt]# parted /dev/sdb mklabel gpt
Warning: The existing disk label on /dev/sdb will be destroyed and all data on
this disk will be lost. Do you want to continue?
Yes/No? yes                                                               
Information: You may need to update /etc/fstab.

[root@Llawyr mnt]# parted /dev/sdb print                            
Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 8025MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start  End  Size  File system  Name  Flags

[root@Llawyr mnt]# parted /dev/sdb mkpart 1 1 4G
Information: You may need to update /etc/fstab.

[root@Llawyr mnt]# parted /dev/sdb print                          
Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 8025MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  4000MB  3999MB  ext4         1


[root@Llawyr mnt]# mkfs -t xfs -f /dev/sdb1
meta-data=/dev/sdb1              isize=256    agcount=4, agsize=244096 blks
         =                       sectsz=512   attr=2, projid32bit=0
data     =                       bsize=4096   blocks=976384, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

[root@Llawyr mnt]# parted /dev/sdb print
Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdb: 8025MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  4000MB  3999MB  xfs          1

[root@Llawyr mnt]# mount -t auto /dev/sdb1 /mnt

[root@Llawyr mnt]# mount
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=6124048k,nr_inodes=1531012,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
 .
 .
 .
/dev/sda3 on /home type ext4 (rw,noatime,data=ordered)
/dev/sda1 on /boot type ext4 (rw,noatime,data=ordered)
/dev/sdb1 on /mnt type xfs (rw,relatime,attr2,inode64,noquota)