잠시만 기다려 주세요

     '검찰공화국, 부패공화국... 윤석열은 내려와라... 그리고 수사 받아라... 당신은 대통령을 할 자격이 없다.'
전체검색 :  
이번주 로또 및 연금번호 발생!!   |  HOME   |  여기는?   |  바다물때표   |  알림 (16)  |  여러가지 팁 (1055)  |  추천 및 재미 (151)  |  자료실 (22)  |  
시사, 이슈, 칼럼, 평론, 비평 (590)  |  끄적거림 (128)  |  문예 창작 (705)  |  바람 따라 (69)  |  시나리오 (760)  |  드라마 대본 (248)  |  
살인!


    freebsd 데스크탑

freebsd 데스크탑 - 디스크 크기 조정, 디스크 사이즈 변경, Resizing and Growing Disks
이 름 : 바다아이   |   조회수 : 8052         짧은 주소 : https://www.bada-ie.com/su/?901593657220
아래 예제는 스왑 파티션을 잠시 지웠다가 고 위에 파티션에 새 용량 합치고
그리고 다시 스왑을 생성해서 잡아주는 과정이네요...
자세히 보시면서 원리 파악하시면 되겠습니다.


Originally contributed by Allan Jude.

A disk's capacity can increase without any changes to the data already present. This happens commonly with virtual machines, when the virtual disk turns out to be too small and is enlarged. Sometimes a disk image is written to a USB memory stick, but does not use the full capacity. Here we describe how to resize or grow disk contents to take advantage of increased capacity.

Determine the device name of the disk to be resized by inspecting /var/run/dmesg.boot. In this example, there is only one SATA disk in the system, so the drive will appear as ada0.

List the partitions on the disk to see the current configuration:

# gpart show ada0
=>      34  83886013  ada0  GPT  (48G) [CORRUPT]
        34       128     1  freebsd-boot  (64k)
       162  79691648     2  freebsd-ufs  (38G)
  79691810   4194236     3  freebsd-swap  (2G)
  83886046         1        - free -  (512B)

Note:

If the disk was formatted with the GPT partitioning scheme, it may show as corrupted because the GPT backup partition table is no longer at the end of the drive. Fix the backup partition table with gpart:

# gpart recover ada0
ada0 recovered

Now the additional space on the disk is available for use by a new partition, or an existing partition can be expanded:

# gpart show ada0
=>       34  102399933  ada0  GPT  (48G)
         34        128     1  freebsd-boot  (64k)
        162   79691648     2  freebsd-ufs  (38G)
   79691810    4194236     3  freebsd-swap  (2G)
   83886046   18513921        - free -  (8.8G)

Partitions can only be resized into contiguous free space. Here, the last partition on the disk is the swap partition, but the second partition is the one that needs to be resized. Swap partitions only contain temporary data, so it can safely be unmounted, deleted, and then recreate the third partition after resizing the second partition.

Disable the swap partition:

# swapoff /dev/ada0p3

Delete the third partition, specified by the -i flag, from the disk ada0.

# gpart delete -i 3 ada0
ada0p3 deleted
# gpart show ada0
=>       34  102399933  ada0  GPT  (48G)
         34        128     1  freebsd-boot  (64k)
        162   79691648     2  freebsd-ufs  (38G)
   79691810   22708157        - free -  (10G)

Warning:

There is risk of data loss when modifying the partition table of a mounted file system. It is best to perform the following steps on an unmounted file system while running from a live CD-ROM or USB device. However, if absolutely necessary, a mounted file system can be resized after disabling GEOM safety features:

# sysctl kern.geom.debugflags=16

Resize the partition, leaving room to recreate a swap partition of the desired size. The partition to resize is specified with -i, and the new desired size with -s. Optionally, alignment of the partition is controlled with -a. This only modifies the size of the partition. The file system in the partition will be expanded in a separate step.

# gpart resize -i 2 -s 47G -a 4k ada0
ada0p2 resized
# gpart show ada0
=>       34  102399933  ada0  GPT  (48G)
         34        128     1  freebsd-boot  (64k)
        162   98566144     2  freebsd-ufs  (47G)
   98566306    3833661        - free -  (1.8G)

Recreate the swap partition and activate it. If no size is specified with -s, all remaining space is used:

# gpart add -t freebsd-swap -a 4k ada0
ada0p3 added
# gpart show ada0
=>       34  102399933  ada0  GPT  (48G)
         34        128     1  freebsd-boot  (64k)
        162   98566144     2  freebsd-ufs  (47G)
   98566306    3833661     3  freebsd-swap  (1.8G)
# swapon /dev/ada0p3

Grow the UFS file system to use the new capacity of the resized partition:

# growfs /dev/ada0p2
Device is mounted read-write; resizing will result in temporary write suspension for /.
It's strongly recommended to make a backup before growing the file system.
OK to grow file system on /dev/ada0p2, mounted on /, from 38GB to 47GB? [Yes/No] Yes
super-block backups (for fsck -b #) at:
 80781312, 82063552, 83345792, 84628032, 85910272, 87192512, 88474752,
 89756992, 91039232, 92321472, 93603712, 94885952, 96168192, 97450432

If the file system is ZFS, the resize is triggered by running the online subcommand with -e:

# zpool online -e zroot /dev/ada0p2

Both the partition and the file system on it have now been resized to use the newly-available disk space.


좀 더 자세한 것은 아래 사이트 참고...

출처 : https://www.freebsd.org/doc/handbook/disks-growing.html

| |





      1 page / 2 page
번 호 카테고리 제 목 이름 조회수
31 freebsd 데스크탑 freebsd , , 바다아이 5509
30 freebsd 데스크탑 freebsd , , pkg mirror 바다아이 7774
현재글 freebsd 데스크탑 , , Resizing and Growing Disks 바다아이 8053
28 freebsd 데스크탑 Port PKG , 바다아이 5795
27 freebsd 데스크탑 freebsd nvidia driver, nvidia 바다아이 8342
26 freebsd 데스크탑 freebsd locale 바다아이 8124
25 freebsd 데스크탑 freebsd , disk partition, diskbandwidth 바다아이 8854
24 freebsd 데스크탑 freebsd , , . shell 바다아이 8315
23 freebsd 데스크탑 freebsd 바다아이 8893
22 freebsd 데스크탑 freebsd , .... hard Transfer speed test 바다아이 8540
21 freebsd 데스크탑 freebsd , , user add del 바다아이 9125
20 freebsd 데스크탑 freebsd geoip 바다아이 8773
19 freebsd 데스크탑 freebsd , .... ko_KR.UTF-8, csh, bash 바다아이 8922
18 freebsd 데스크탑 FreeBSD csh linux bash 바다아이 8725
17 freebsd 데스크탑 freebsd , , , ls, ll ... 바다아이 9452
16 freebsd 데스크탑 freebsd, linux top cpu , cpu , core 바다아이 8928
15 freebsd 데스크탑 , freebsd tar , 바다아이 9646
14 freebsd 데스크탑 freebsd pkg repo 바다아이 9696
13 freebsd 데스크탑 freebsd , , , libreoffice 바다아이 10895
12 freebsd 데스크탑 freebsd , , 바다아이 12527
11 freebsd 데스크탑 freebsd .... ... 바다아이 9681
10 freebsd 데스크탑 freebsd smplayer mpv mplayer vlc 바다아이 9048
9 freebsd 데스크탑 freebsd , 바다아이 10145
8 freebsd 데스크탑 freebsd zfs , , 바다아이 9485
7 freebsd 데스크탑 freebsd virtualbox 바다아이 8506
6 freebsd 데스크탑 freebsd zfs ... 바다아이 9034
5 freebsd 데스크탑 freebsd firefox thunderbird 바다아이 9750
4 freebsd 데스크탑 freebsd navi , , xfce4 바다아이 10904
3 freebsd 데스크탑 freebsd kernel , nvidia 바다아이 8878
2 freebsd 데스크탑 freebsd ext4 바다아이 9444
| |









Copyright ⓒ 2001.12. bada-ie.com. All rights reserved.
이 사이트는 리눅스에서 firefox 기준으로 작성되었습니다. 기타 브라우저에서는 다르게 보일 수 있습니다.
[ Ubuntu + GoLang + PostgreSQL + Mariadb ]
서버위치 : 오라클 클라우드 춘천  실행시간 : 0.0738
to webmaster... gogo sea. gogo sea.