![]() ![]() After writing 'w', device sda2 will be restored. Simply use fdisk again, create new partition as swap. EXT4 is growable on the fly :), use resize2fs /dev/sda1 for do it. ![]() After reboot you have prepared larger partition, but filesystem on it is still smaller. If it still fails, you should reboot your system. If failed, you can call command partx /dev/sda for doing sync. You will see information all is synced, or sync is failed. Print this (it is still in fdisk temporary memory), and look all is ok.Īfter this press 'w' key, this will tru write new partitioning to the drive. Multiple it by 2, and subtract this number from last sector number prompted by fdisk. Use calculator and assign in your mind how much swap do you need in kilobytes. fdisk prompts you for last available sector. See on what sector original partition started. Next create new partition, but be careful. After print you see, no partition exist on the disk. Don't panic, nothing is written to hard drive :). Using fdisk you should firstly print partition. When you don't have this partition, you can enlarge your sda1. if swapon tells you (see man) no swap is used, you can remove it by partition tool (fdisk or similar). You should do swapoff, remark this in /etc/fstab. (second "but") if you still want keep your current structure, you should first remove swap partition. On that directories are stored the most user and system data, and it is possible to securely move data from that directories to new partitions.īut. I suggest creating other partitions after sda1 & sda2, mounted as /home and /usr. Rest of disk should be used for other partitions.īut what with this situation? I don't recommend expanding sda1. After boot partition should be swap partition. Why at the beginning? because many tools have got problems with end of large disk above 2TB barrier. it isn't good because swap can be heavily loaded, and end of rotated disk is the slowest part of it. On the beginning is a single partition, and on the end a swap partition is located. I know this is very old issue, but many people are looking for that resolve.įor this example you have the following typical situation. Which for ext4 will work just fine even on a live FS. Then, resize the filesystem so it spreads to the extent of the enlarged partition (might be located in /sbin): resize2fs /dev/sda1 However, if in-use partitions were only enlarged, you should be able to force the kernel to take the new layout with: partx /dev/sda The partition table will have been modified but the kernel will not be able to take that into account as some partitions are mounted. Change the type if needed with t (for partitions holding an extX or btrfs filesystem, the default of 83 is fine). ![]() Try to align things on a megabyte boundary that is for end, make it a multiple of 2048 minus 1. Recreate it using command n with same number (1), start and type but with a bigger end (taking care not to overlap with other partitions). P to print the partition table, take note of the number, start, end, type of sda1. Enlarge the partition: fdisk -u /dev/sda. ![]()
0 Comments
Leave a Reply. |