Monday, November 29, 2010

Resizing of Paration without Loss of Data



Create New Partaion of size +20M
# fdisk -l
# fdisk /dev/sda
p
n
enter defaul size
+20M
w
# partprobe /dev/sda
# fdisk -l

Mount New Partition on /mymount
# cd Desktop/
# ls
# mkdir /mymount
# vim /etc/fstab (For permanent mount )
# mkfs.ext3 /dev/sda9
# mount -a
# df -h
# cd /mymount/

Create Some sample File And Folder For testing
# touch a1
# touch a11
# touch a111
# touch a111
# touch a1111
# touch a11111
# ls
# mkdir a2
# mkdir a22
# mkdir a222
# mkdir a222
# mkdir a2222
# mkdir a22222
# ls
# umount /dev/sda9
# fsck -n /dev/sda9
# tune2fs -O ^has_journal /dev/sda9
Now delete Partition and again create Partition with increasing size +40M
# fdisk /dev/sda
p
d
n
partition number
default size press enter
give size +40M
w
# partprobe /dev/sda
# e2fsck -f /dev/sda9
# resize2fs /dev/sda9
# fsck -n /dev/sda9
# tune2fs -j /dev/sda9
# partprobe /dev/sda
# mount -a
# df -h
# cd /mymount/
# ls // (check whether data is lost or not)

No comments:

Post a Comment