-
Notifications
You must be signed in to change notification settings - Fork 0
/
Comandos_de_la_terminal%2Fparted.mw
269 lines (219 loc) · 9.74 KB
/
Comandos_de_la_terminal%2Fparted.mw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
__NOTOC__
* [[:#parted | parted]]
== parted ==
<syntaxhighlight lang="bash">
[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 [email protected]
[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)
</syntaxhighlight>
[[Category:Comandos de la terminal]]