why when i change the partition table the data above stays intact?
Hi all
I got this ubuntu 16.04 VM that I am learning about gdisk on. I created a 1G img file and mounted it on a folder and it works. I can write to the folders and read etc. Then I decided to change the partition block size from 2M to 4M just for kicks. I had expected that to cause problems such as data loss or corruption. But I can still read and write from my test files. I thought since partition is how the blocks on the disk is allocated, but if I change that, shouldn't that negatively affect the files on top? Thanks |
How did you create the image file, what filesystem did you format it as and how did you change the partition block size?
|
Where and how did you change the "partition block size"? There is no such field in either the GUID or legacy MBR partition table, so what did you change?
|
Hi
I did the following: Code:
dd if=/dev/zero of=test.img bs=1M count=1000 |
No, the bs option specifies the number of bytes the dd command reads/writes at a time and is not the block size of the filesystem. You can change that when you create the filesystem via the mkfs command but the system knows the value when it is mounted.
It is possible to create a partition table and filesystems within a loop file but it is a bit more complicated. |
All times are GMT -5. The time now is 03:04 AM. |