Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!

Ogłoszenie

Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

#1  2013-07-25 14:57:06

  morfik - Cenzor wirtualnego świata

morfik
Cenzor wirtualnego świata
Skąd: ze WSI
Zarejestrowany: 2011-09-15
Serwis

[SOLVED] Zwiększenie rozmiaru pliku .img

Mam dwa pliki .img oba zrobione przy pomocy live-build.

plik binary_xfce4_base.img

Kod:

Type: unknown
application/octet-stream

Total size: 389.0 M  ( 407896064 bytes )
Size od disk: 389.4 M  ( 408301568 bytes )

plik live-image-i386

Kod:

Type: unknown
application/octet-stream

Total size: 230.0 M  ( 241172480 bytes )
Size od disk: 226.5 M  ( 237453312 bytes )

Przy wgraniu binary_xfce4_base.img na pena i przywróceniu samej tylko tablicy partycji (dd if=mbr of=/dev/sdb bs=1 count=64 skip=446 seek=446) tak by wróciła uprzednio utworzona partycja 3GiB, można bez problemu fixnąć partycję w gparted/parted uzyskując możliwość wgrania danych w każde miejsce tej partycji.

Log z parted:

Kod:

# parted /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resize 1                                                         
WARNING: you are attempting to use parted to operate on (resize) a file system.
parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs.  We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Start?  [1049kB]?                                                         
End?  [3222MB]?                                                           
(parted)

Log z gparted:

Kod:

GParted 0.16.1 --enable-libparted-dmraid

Libparted 2.3
Check and repair file system (fat32) on /dev/sdb1  00:00:02    ( SUCCESS )
         
calibrate /dev/sdb1  00:00:00    ( SUCCESS )
         
path: /dev/sdb1
start: 2048
end: 6293503
size: 6291456 (3.00 GiB)
check file system on /dev/sdb1 for errors and (if possible) fix them  00:00:00    ( SUCCESS )
         
dosfsck -a -w -v /dev/sdb1
         
dosfsck 3.0.16 (01 Mar 2013)
dosfsck 3.0.16, 01 Mar 2013, FAT32, LFN
Checking we can access the last sector of the filesystem
There are differences between boot sector and its backup.
Differences: (offset:original/backup)
3:53/6d, 4:59/6b, 5:53/64, 6:4c/6f, 7:49/73, 8:4e/66, 9:55/73, 10:58/00
, 90:fa/0e, 91:fc/1f, 92:31/be, 93:c9/77, 94:8e/7c, 95:d1/ac, 96:bc/22
, 97:76/c0, 98:7b/74, 99:52/0b, 100:06/56, 101:57/b4, 102:1e/0e, 103:56/bb
, 104:8e/07, 105:c1/00, 106:b1/cd, 107:26/10, 108:bf/5e, 109:78/eb
, 110:7b/f0, 111:f3/32, 112:a5/e4, 113:8e/cd, 114:d9/16, 115:bb/cd
, 116:78/19, 117:00/eb, 118:0f/fe, 119:b4/54, 120:37/68, 121:0f/69
, 122:a0/73, 123:56/20, 124:20/69, 125:d2/73, 126:78/20, 127:1b/6e
, 128:31/6f, 129:c0/74, 130:b1/20, 131:06/61, 132:89/20, 133:3f/62
, 134:89/6f, 135:47/6f, 136:02/74, 137:f3/61, 138:64/62, 139:a5/6c
, 140:8a/65, 141:0e/20, 142:18/64, 143:7c/69, 144:88/73, 145:4d/6b
, 146:f8/2e, 147:50/20, 148:50/20, 150:50/6c, 151:cd/65, 152:13/61
, 153:eb/73, 154:62/65, 155:8b/20, 156:55/69, 157:aa/6e, 158:8b/73
, 159:75/65, 160:a8/72, 161:c1/74, 162:ee/20, 163:04/61, 164:01/20
, 165:f2/62, 166:83/6f, 167:fa/6f, 168:4f/74, 169:76/61, 170:31/62
, 171:81/6c, 172:fa/65, 173:b2/20, 174:07/66, 175:73/6c, 176:2b/6f
, 177:f6/70, 178:45/70, 179:b4/79, 180:7f/20, 181:75/61, 182:25/6e
, 183:38/64, 184:4d/0d, 185:b8/0a, 186:74/70, 187:20/72, 188:66/65
, 189:3d/73, 190:21/73, 191:47/20, 192:50/61, 193:54/6e, 194:75/79
, 195:10/20, 196:80/6b, 197:7d/65, 198:b8/79, 199:ed/20, 200:75/74
, 201:0a/6f, 202:66/20, 203:ff/74, 204:75/72, 205:ec/79, 206:66/20
, 207:ff/61, 208:75/67, 209:e8/61, 210:eb/69, 211:0f/6e, 212:51/20
, 213:51/2e, 214:66/2e, 215:ff/2e, 216:75/20, 217:bc/0d, 218:eb/0a
, 219:07/00, 220:51/00, 221:51/00, 222:66/00, 223:ff/00, 224:36/00
, 225:1c/00, 226:7c/00, 227:b4/00, 228:08/00, 229:e8/00, 230:e9/00
, 232:72/00, 233:13/00, 234:20/00, 235:e4/00, 236:75/00, 237:0f/00
, 238:c1/00, 239:ea/00, 240:08/00, 241:42/00, 242:89/00, 243:16/00
, 244:1a/00, 245:7c/00, 246:83/00, 247:e1/00, 248:3f/00, 249:89/00
, 250:0e/00, 251:18/00, 252:7c/00, 253:fb/00, 254:bb/00, 255:aa/00
, 256:55/00, 257:b4/00, 258:41/00, 259:e8/00, 260:cb/00, 262:72/00
, 263:10/00, 264:81/00, 265:fb/00, 266:55/00, 267:aa/00, 268:75/00
, 269:0a/00, 270:f6/00, 271:c1/00, 272:01/00, 273:74/00, 274:05/00
, 275:c6/00, 276:06/00, 277:46/00, 278:7d/00, 280:66/00, 281:b8/00
, 282:28/00, 283:c3/00, 284:0b/00, 286:66/00, 287:ba/00, 292:bb/00
, 294:80/00, 295:e8/00, 296:0e/00, 298:66/00, 299:81/00, 300:3e/00
, 301:1c/00, 302:80/00, 303:2a/00, 304:0b/00, 305:1d/00, 306:6f/00
, 307:75/00, 308:74/00, 309:e9/00, 310:f8/00, 311:02/00, 312:66/00
, 313:03/00, 314:06/00, 315:60/00, 316:7b/00, 317:66/00, 318:13/00
, 319:16/00, 320:64/00, 321:7b/00, 322:b9/00, 323:10/00, 325:eb/00
, 326:2b/00, 327:66/00, 328:52/00, 329:66/00, 330:50/00, 331:06/00
, 332:53/00, 333:6a/00, 334:01/00, 335:6a/00, 336:10/00, 337:89/00
, 338:e6/00, 339:66/00, 340:60/00, 341:b4/00, 342:42/00, 343:e8/00
, 344:77/00, 346:66/00, 347:61/00, 348:8d/00, 349:64/00, 350:10/00
, 351:72/00, 352:01/00, 353:c3/00, 354:66/00, 355:60/00, 356:31/00
, 357:c0/00, 358:e8/00, 359:68/00, 361:66/00, 362:61/00, 363:e2/00
, 364:da/00, 365:c6/00, 366:06/00, 367:46/00, 368:7d/00, 369:2b/00
, 370:66/00, 371:60/00, 372:66/00, 373:0f/00, 374:b7/00, 375:36/00
, 376:18/00, 377:7c/00, 378:66/00, 379:0f/00, 380:b7/00, 381:3e/00
, 382:1a/00, 383:7c/00, 384:66/00, 385:f7/00, 386:f6/00, 387:31/00
, 388:c9/00, 389:87/00, 390:ca/00, 391:66/00, 392:f7/00, 393:f7/00
, 394:66/00, 395:3d/00, 396:ff/00, 397:03/00, 400:77/00, 401:17/00
, 402:c0/00, 403:e4/00, 404:06/00, 405:41/00, 406:08/00, 407:e1/00
, 408:88/00, 409:c5/00, 410:88/00, 411:d6/00, 412:b8/00, 413:01/00
, 414:02/00, 415:e8/00, 416:2f/00, 418:66/00, 419:61/00, 420:72/00
, 421:01/00, 422:c3/00, 423:e2/00, 424:c9/00, 425:31/00, 426:f6/00
, 427:8e/00, 428:d6/00, 429:bc/00, 430:68/00, 431:7b/00, 432:8e/00
, 433:de/00, 434:66/00, 435:8f/00, 436:06/00, 437:78/00, 439:be/00
, 440:da/00, 441:7d/00, 442:ac/00, 443:20/00, 444:c0/00, 445:74/00
, 446:09/00, 447:b4/00, 448:0e/00, 449:bb/00, 450:07/00, 452:cd/00
, 453:10/00, 454:eb/00, 455:f2/00, 456:31/00, 457:c0/00, 458:cd/00
, 459:16/00, 460:cd/00, 461:19/00, 462:f4/00, 463:eb/00, 464:fd/00
, 465:8a/00, 466:16/00, 467:74/00, 468:7b/00, 469:06/00, 470:cd/00
, 471:13/00, 472:07/00, 473:c3/00, 474:42/00, 475:6f/00, 476:6f/00
, 477:74/00, 478:20/00, 479:65/00, 480:72/00, 481:72/00, 482:6f/00
, 483:72/00, 484:0d/00, 485:0a/00, 504:fe/00, 505:02/00, 506:b2/00
, 507:3e/00, 508:18/00, 509:37/00
Not automatically fixing this.
Boot sector contents:
System ID "SYSLINUX"
Media byte 0xf8 (hard disk)
512 bytes per logical sector
4096 bytes per cluster
32 reserved sectors
First FAT starts at byte 16384 (sector 32)
2 FATs, 32 bit entries
397312 bytes per FAT (= 776 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 811008 (sector 1584)
99130 data clusters (406036480 bytes)
32 sectors/track, 64 heads
0 hidden sectors
794624 sectors total
Reclaiming unconnected clusters.
Checking free cluster summary.
/dev/sdb1: 23 files, 96167/99130 clusters
grow file system to fill the partition  00:00:02    ( SUCCESS )
         
using libparted

========================================

Przy wgraniu drugiego obrazu -- live-image-i386 , powyższa metoda nie zdaje egzaminu.

Log z parted:

Kod:

# parted /dev/sdb
GNU Parted 2.3
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resize 1                                                         
WARNING: you are attempting to use parted to operate on (resize) a file system.
parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs.  We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Start?  [1049kB]?                                                         
End?  [3222MB]?                                                           
No Implementation: GNU Parted cannot resize this partition to this size.  We're working on it!

Log z gparted:

Kod:

GParted 0.16.1 --enable-libparted-dmraid

Libparted 2.3
Check and repair file system (fat32) on /dev/sdb1  00:00:01    ( ERROR )
         
calibrate /dev/sdb1  00:00:00    ( SUCCESS )
         
path: /dev/sdb1
start: 2048
end: 6293503
size: 6291456 (3.00 GiB)
check file system on /dev/sdb1 for errors and (if possible) fix them  00:00:01    ( SUCCESS )
         
dosfsck -a -w -v /dev/sdb1
         
dosfsck 3.0.16 (01 Mar 2013)
dosfsck 3.0.16, 01 Mar 2013, FAT32, LFN
Checking we can access the last sector of the filesystem
There are differences between boot sector and its backup.
Differences: (offset:original/backup)
3:53/6d, 4:59/6b, 5:53/64, 6:4c/6f, 7:49/73, 8:4e/66, 9:55/73, 10:58/00
, 90:fa/0e, 91:fc/1f, 92:31/be, 93:c9/77, 94:8e/7c, 95:d1/ac, 96:bc/22
, 97:76/c0, 98:7b/74, 99:52/0b, 100:06/56, 101:57/b4, 102:1e/0e, 103:56/bb
, 104:8e/07, 105:c1/00, 106:b1/cd, 107:26/10, 108:bf/5e, 109:78/eb
, 110:7b/f0, 111:f3/32, 112:a5/e4, 113:8e/cd, 114:d9/16, 115:bb/cd
, 116:78/19, 117:00/eb, 118:0f/fe, 119:b4/54, 120:37/68, 121:0f/69
, 122:a0/73, 123:56/20, 124:20/69, 125:d2/73, 126:78/20, 127:1b/6e
, 128:31/6f, 129:c0/74, 130:b1/20, 131:06/61, 132:89/20, 133:3f/62
, 134:89/6f, 135:47/6f, 136:02/74, 137:f3/61, 138:64/62, 139:a5/6c
, 140:8a/65, 141:0e/20, 142:18/64, 143:7c/69, 144:88/73, 145:4d/6b
, 146:f8/2e, 147:50/20, 148:50/20, 150:50/6c, 151:cd/65, 152:13/61
, 153:eb/73, 154:62/65, 155:8b/20, 156:55/69, 157:aa/6e, 158:8b/73
, 159:75/65, 160:a8/72, 161:c1/74, 162:ee/20, 163:04/61, 164:01/20
, 165:f2/62, 166:83/6f, 167:fa/6f, 168:4f/74, 169:76/61, 170:31/62
, 171:81/6c, 172:fa/65, 173:b2/20, 174:07/66, 175:73/6c, 176:2b/6f
, 177:f6/70, 178:45/70, 179:b4/79, 180:7f/20, 181:75/61, 182:25/6e
, 183:38/64, 184:4d/0d, 185:b8/0a, 186:74/70, 187:20/72, 188:66/65
, 189:3d/73, 190:21/73, 191:47/20, 192:50/61, 193:54/6e, 194:75/79
, 195:10/20, 196:80/6b, 197:7d/65, 198:b8/79, 199:ed/20, 200:75/74
, 201:0a/6f, 202:66/20, 203:ff/74, 204:75/72, 205:ec/79, 206:66/20
, 207:ff/61, 208:75/67, 209:e8/61, 210:eb/69, 211:0f/6e, 212:51/20
, 213:51/2e, 214:66/2e, 215:ff/2e, 216:75/20, 217:bc/0d, 218:eb/0a
, 219:07/00, 220:51/00, 221:51/00, 222:66/00, 223:ff/00, 224:36/00
, 225:1c/00, 226:7c/00, 227:b4/00, 228:08/00, 229:e8/00, 230:e9/00
, 232:72/00, 233:13/00, 234:20/00, 235:e4/00, 236:75/00, 237:0f/00
, 238:c1/00, 239:ea/00, 240:08/00, 241:42/00, 242:89/00, 243:16/00
, 244:1a/00, 245:7c/00, 246:83/00, 247:e1/00, 248:3f/00, 249:89/00
, 250:0e/00, 251:18/00, 252:7c/00, 253:fb/00, 254:bb/00, 255:aa/00
, 256:55/00, 257:b4/00, 258:41/00, 259:e8/00, 260:cb/00, 262:72/00
, 263:10/00, 264:81/00, 265:fb/00, 266:55/00, 267:aa/00, 268:75/00
, 269:0a/00, 270:f6/00, 271:c1/00, 272:01/00, 273:74/00, 274:05/00
, 275:c6/00, 276:06/00, 277:46/00, 278:7d/00, 280:66/00, 281:b8/00
, 282:54/00, 283:11/00, 284:07/00, 286:66/00, 287:ba/00, 292:bb/00
, 294:80/00, 295:e8/00, 296:0e/00, 298:66/00, 299:81/00, 300:3e/00
, 301:1c/00, 302:80/00, 303:2a/00, 304:0b/00, 305:1d/00, 306:6f/00
, 307:75/00, 308:74/00, 309:e9/00, 310:f8/00, 311:02/00, 312:66/00
, 313:03/00, 314:06/00, 315:60/00, 316:7b/00, 317:66/00, 318:13/00
, 319:16/00, 320:64/00, 321:7b/00, 322:b9/00, 323:10/00, 325:eb/00
, 326:2b/00, 327:66/00, 328:52/00, 329:66/00, 330:50/00, 331:06/00
, 332:53/00, 333:6a/00, 334:01/00, 335:6a/00, 336:10/00, 337:89/00
, 338:e6/00, 339:66/00, 340:60/00, 341:b4/00, 342:42/00, 343:e8/00
, 344:77/00, 346:66/00, 347:61/00, 348:8d/00, 349:64/00, 350:10/00
, 351:72/00, 352:01/00, 353:c3/00, 354:66/00, 355:60/00, 356:31/00
, 357:c0/00, 358:e8/00, 359:68/00, 361:66/00, 362:61/00, 363:e2/00
, 364:da/00, 365:c6/00, 366:06/00, 367:46/00, 368:7d/00, 369:2b/00
, 370:66/00, 371:60/00, 372:66/00, 373:0f/00, 374:b7/00, 375:36/00
, 376:18/00, 377:7c/00, 378:66/00, 379:0f/00, 380:b7/00, 381:3e/00
, 382:1a/00, 383:7c/00, 384:66/00, 385:f7/00, 386:f6/00, 387:31/00
, 388:c9/00, 389:87/00, 390:ca/00, 391:66/00, 392:f7/00, 393:f7/00
, 394:66/00, 395:3d/00, 396:ff/00, 397:03/00, 400:77/00, 401:17/00
, 402:c0/00, 403:e4/00, 404:06/00, 405:41/00, 406:08/00, 407:e1/00
, 408:88/00, 409:c5/00, 410:88/00, 411:d6/00, 412:b8/00, 413:01/00
, 414:02/00, 415:e8/00, 416:2f/00, 418:66/00, 419:61/00, 420:72/00
, 421:01/00, 422:c3/00, 423:e2/00, 424:c9/00, 425:31/00, 426:f6/00
, 427:8e/00, 428:d6/00, 429:bc/00, 430:68/00, 431:7b/00, 432:8e/00
, 433:de/00, 434:66/00, 435:8f/00, 436:06/00, 437:78/00, 439:be/00
, 440:da/00, 441:7d/00, 442:ac/00, 443:20/00, 444:c0/00, 445:74/00
, 446:09/00, 447:b4/00, 448:0e/00, 449:bb/00, 450:07/00, 452:cd/00
, 453:10/00, 454:eb/00, 455:f2/00, 456:31/00, 457:c0/00, 458:cd/00
, 459:16/00, 460:cd/00, 461:19/00, 462:f4/00, 463:eb/00, 464:fd/00
, 465:8a/00, 466:16/00, 467:74/00, 468:7b/00, 469:06/00, 470:cd/00
, 471:13/00, 472:07/00, 473:c3/00, 474:42/00, 475:6f/00, 476:6f/00
, 477:74/00, 478:20/00, 479:65/00, 480:72/00, 481:72/00, 482:6f/00
, 483:72/00, 484:0d/00, 485:0a/00, 504:fe/00, 505:02/00, 506:b2/00
, 507:3e/00, 508:18/00, 509:37/00
Not automatically fixing this.
Boot sector contents:
System ID "SYSLINUX"
Media byte 0xf8 (hard disk)
512 bytes per logical sector
512 bytes per cluster
32 reserved sectors
First FAT starts at byte 16384 (sector 32)
2 FATs, 32 bit entries
1847296 bytes per FAT (= 3608 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 3710976 (sector 7248)
461744 data clusters (236412928 bytes)
32 sectors/track, 64 heads
0 hidden sectors
468992 sectors total
Reclaiming unconnected clusters.
Checking free cluster summary.
/dev/sdb1: 22 files, 456003/461744 clusters
grow file system to fill the partition  00:00:00    ( ERROR )
         
using libparted
libparted messages    ( INFO )
         
GNU Parted cannot resize this partition to this size. We're working on it!

========================================

Mając na uwadze powyższe, muszę w jakiś inny sposób zrobić miejsce na ewentualne zmiany w obrazie .img . Najprościej by było chyba rozszerzyć obraz img i ten powiększony już obraz wgrać na pena.

W obrazie .img , jest obecny system plików fat , przynajmniej tak pokazuje gparted po wgraniu obrazu. Próbowałem iść zgodnie z instrukcjami w linku http://forum.xda-developers.com/showthread.php?t=737826 ale coś mi to nie działa jak trza. xD

Kod:

# cp live-image-i386 live-image-i386.base
# dd if=/dev/zero bs=1M count=256 >> live-image-i386
256+0 records in
256+0 records out
268435456 bytes (268 MB) copied, 2.06256 s, 130 MB/s
# ls -al | grep live
-rw-r--r--  1 root   root     486M Jul 25 14:25 live-image-i386
-rw-r--r--  1 root   root     230M Jul 25 14:24 live-image-i386.base

# dosfsck live-image-i386
dosfsck 3.0.16, 01 Mar 2013, FAT32, LFN
Logical sector size (1766 bytes) is not a multiple of the physical sector size.

# resize2fs live-image-i386
resize2fs 1.42.5 (29-Jul-2012)
resize2fs: Bad magic number in super-block while trying to open live-image-i386
Couldn't find valid filesystem superblock.

Jakieś pomysły co do tego jak powiększyć obraz img?

Ostatnio edytowany przez morfik (2013-10-29 14:27:10)

Offline

 

#2  2013-10-29 14:26:41

  morfik - Cenzor wirtualnego świata

morfik
Cenzor wirtualnego świata
Skąd: ze WSI
Zarejestrowany: 2011-09-15
Serwis

Re: [SOLVED] Zwiększenie rozmiaru pliku .img

W końcu udało mi się rozwikłać ten problem ale po kolei. Przede wszystkim te obrazy robione przez live-build to nie są zwyczajne obrazy, które można od tak zamontować używając do tego polecenia mount. Posiadają one bowiem mbr, co powoduje, że system plików tego obrazu jest zwyczajnie nie znany, bo czytany jest nie ten sektor co potrzeba.

Przykładowo, tak wygląda mój nowy obraz zrobiony przez live-build, już rozszerzony o 400MB z /dev/zero przy pomocy dd.

Kod:

Disk /media/Server/live/binary.img: 1666MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
        16.4kB  1049kB  1032kB           Free Space
 1      1049kB  1247MB  1246MB  primary  fat32        boot
        1247MB  1666MB  419MB            Free Space

Dobrze wiedzieć, że parted jak i fdisk można używać na obrazach img xD

Jak widać, przed pierwszą partycją jest trochę wolnej przestrzeni, temu właśnie mount nie ma pojęcia jakiego systemu plików używa dany obraz i nie wie jak go zamontować. Ale mount potrafi montować obraz od określonego miejsca za pośrednictwem parametru offset . Czyli niekoniecznie trzeba obcinać mbr + wolne miejsce by zamontować ten obraz live. Zatem można ten obraz montować na dwa sposoby:

Kod:

# mount -o loop,offset=1048576 binary.img /mnt

albo

Kod:

# dd if=binary.img of=binary.img.bez.mbr bs=2048 skip=512
# mount -o loop binary.img.bez.mbr /mnt

Skąd te liczby? 1048576 = 2048x512, a te 2048 i 512? To trzeba odczytać np. z fdiska:

Kod:

# fdisk -l binary.img

Disk binary.img: 1246 MB, 1246756864 bytes
147 heads, 59 sectors/track, 280 cylinders, total 2435072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001fe2e

          Device Boot      Start         End      Blocks   Id  System
binary.img.base1   *        2048     2435071     1216512   83  Linux

512 to rozmiar sektora, zaś 2048 to start pierwszej partycji. Czyli trzeba wykroić/pominąć przestrzeń przed pierwszą partycją by dostać się do systemu plików zauważalnego przez mount.

Ale mi generalnie zależało na zwiększeniu pojemności obrazu, ale jeśli można korzystać z parted na takim obrazie to rzecz wydaje się teraz banalna. xD Po dodaniu pożądanej ilości miejsca do obrazu img odpalamy:

Kod:

# parted binary.img
GNU Parted 2.3
Using /media/Server/live/binary.img
Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) print free                                                       
Model:  (file)
Disk /media/Server/live/binary.img: 1666MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
        16.4kB  1049kB  1032kB           Free Space
 1      1049kB  1247MB  1246MB  primary  fat32        boot
        1247MB  1666MB  419MB            Free Space

(parted) resize 1                                                         
WARNING: you are attempting to use parted to operate on (resize) a file system.
parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs.  We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Start?  [1049kB]?                                                         
End?  [1247MB]? 1666MB                                                    

(parted) print free                                                       
Model:  (file)
Disk /media/Server/live/binary.img: 1666MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
        16.4kB  1049kB  1032kB           Free Space
 1      1049kB  1666MB  1665MB  primary  fat32        boot
        1666MB  1666MB  512B             Free Space

(parted) q

Przed:

Kod:

USAGE
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/loop0     vfat  1.2G  1.2G   34M  98% /mnt

Po:

Kod:

USAGE
Filesystem     Type  Size  Used Avail Use% Mounted on
/dev/loop0     vfat  1.6G  1.2G  433M  73% /mnt

I po sprawie, 400MB zostało dołączone do obrazu img.

Ostatnio edytowany przez morfik (2013-10-29 14:31:05)

Offline

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
Nas ludzie lubią po prostu, a nie klikając w przyciski ;-)

[ Generated in 0.012 seconds, 15 queries executed ]

Informacje debugowania

Time (s) Query
0.00012 SET CHARSET latin2
0.00005 SET NAMES latin2
0.00133 SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='3.141.2.191' WHERE u.id=1
0.00069 UPDATE punbb_online SET logged=1732899415 WHERE ident='3.141.2.191'
0.00056 SELECT * FROM punbb_online WHERE logged<1732899115
0.00059 DELETE FROM punbb_online WHERE ident='18.116.23.59'
0.00052 DELETE FROM punbb_online WHERE ident='18.117.105.215'
0.00077 DELETE FROM punbb_online WHERE ident='54.36.149.17'
0.00069 DELETE FROM punbb_online WHERE ident='54.36.149.86'
0.00081 SELECT topic_id FROM punbb_posts WHERE id=237741
0.00105 SELECT id FROM punbb_posts WHERE topic_id=24001 ORDER BY posted
0.00082 SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=24001 AND t.moved_to IS NULL
0.00005 SELECT search_for, replace_with FROM punbb_censoring
0.00108 SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=24001 ORDER BY p.id LIMIT 0,25
0.00076 UPDATE punbb_topics SET num_views=num_views+1 WHERE id=24001
Total query time: 0.00989 s