[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Fdisk



I did it. I first erased all parts. Without saying "W". Then I called
the new section and gave default values.
I've done it the next time I restart. :)

#resize2fs /dev/sda1

On Fri, Jan 20, 2017 at 1:11 PM,  <tomas@tuxteam.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Fri, Jan 20, 2017 at 11:59:36AM +0200, Georgi Naplatanov wrote:
>> On 01/20/2017 11:54 AM, Gokan Atmaca wrote:
>> > Hello
>> >
>> > Debian is running as a VM on the KVM. I enlarged the disk with QEMU.
>> > But the disk is as follows.
>> > So he did not grow up.
>> >
>> > Pre:
>> > root@debian:/home/gokan# fdisk  -l
>> >
>> > Disk /dev/sda:[b] 40 GiB[/b], 42949672960 bytes, 83886080 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
>> > Disklabel type: dos
>> > Disk identifier: 0x6845f24a
>> >
>> > Device     Boot    Start      End  Sectors  Size Id Type
>> > /dev/sda1  *        2048 80383999 80381952 38.3G 83 Linux
>> > /dev/sda2       80386046 83884031  3497986  1.7G  5 Extended
>> > /dev/sda5       80386048 83884031  3497984  1.7G 82 Linux swap / Solaris
>> >
>> > root@debian:/home/gokan#
>> > root@debian:/home/gokan# df -Th
>> > Filesystem     Type      Size  Used Avail Use% Mounted on
>> > /dev/sda1      ext4       38G  908M   35G   3% /
>> > udev           devtmpfs   10M     0   10M   0% /dev
>> > tmpfs          tmpfs     201M  4.4M  196M   3% /run
>> > tmpfs          tmpfs     501M     0  501M   0% /dev/shm
>> > tmpfs          tmpfs     5.0M     0  5.0M   0% /run/lock
>> > tmpfs          tmpfs     501M     0  501M   0% /sys/fs/cgroup
>> >
>> > Post:
>> > root@debian:/home/gokan# fdisk -l
>> >
>> > Disk /dev/sda:[b] 50 GiB[/b], 53687091200 bytes, 104857600 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
>> > Disklabel type: dos
>> > Disk identifier: 0x6845f24a
>> >
>> > Device     Boot    Start      End  Sectors  Size Id Type
>> > /dev/sda1  *        2048 80383999 80381952 38.3G 83 Linux
>> > /dev/sda2       80386046 83884031  3497986  1.7G  5 Extended
>> > /dev/sda5       80386048 83884031  3497984  1.7G 82 Linux swap / Solaris
>> >
>> > root@debian:/home/gokan#
>> > root@debian:/home/gokan# df -Th
>> > Filesystem     Type      Size  Used Avail Use% Mounted on
>> > /dev/sda1      ext4       38G  908M   35G   3% /
>> > udev           devtmpfs   10M     0   10M   0% /dev
>> > tmpfs          tmpfs     201M  4.4M  196M   3% /run
>> > tmpfs          tmpfs     501M     0  501M   0% /dev/shm
>> > tmpfs          tmpfs     5.0M     0  5.0M   0% /run/lock
>> > tmpfs          tmpfs     501M     0  501M   0% /sys/fs/cgroup
>> >
>> > How can I grow this disc?
>>
>> Hi,
>>
>> after enlarging disk or logical volume (in case of LVM), you have to
>> enlarge file system.
>
> Exactly. The disk is bigger now, but you have to do something with
> this extra space.
>
>  (1) You could make an extra partition (that would go after sda5,
>      that is your swap space) and put a file system on it, then
>      e.g. mount it
>
>  (2) you could try to add your new space to your existing swap
>      partition. Just disable swap (swapoff), enlarge sda5 (fdisk),
>      make new swap (mkswap), re-enable swap (swapon).
>
>  (3) you could try to add your new space to your existing root
>      partition (sda1). Problem is, the swap is on the way. So
>      first disable swap, remove swap partition (as in (2)), delete
>      swap partition (fdisk), enlarge sda1 (still fdisk), re-create
>      swap at the end (still fdisk). When finished, and all is
>      well, then you can resize your file system (resize2fs). Note
>      that root can't be mounted read/write for that.
>
>  (4-n) you could use LVM...
>
> I guess you want (3).
>
> Regards
> - -- t
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAliB4kcACgkQBcgs9XrR2kb80gCdEYOlD7WNf2PEujXXs6SCC3hP
> KLcAn0OcfH+JNlXFth5ftiIPRHJRlVXA
> =JUyi
> -----END PGP SIGNATURE-----
>


Reply to: