LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-27-2017, 04:23 PM   #1
jzoudavy
Member
 
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 188

Rep: Reputation: Disabled
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
 
Old 02-27-2017, 06:04 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
How did you create the image file, what filesystem did you format it as and how did you change the partition block size?
 
1 members found this post helpful.
Old 02-27-2017, 06:52 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
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?
 
Old 02-27-2017, 09:36 PM   #4
jzoudavy
Member
 
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 188

Original Poster
Rep: Reputation: Disabled
Hi

I did the following:

Code:
dd if=/dev/zero of=test.img bs=1M count=1000
mkfs.ext3 test.img
fdisk test.img
 
Old 02-28-2017, 03:19 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
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.

Last edited by michaelk; 02-28-2017 at 05:01 AM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need to change f.s. id in partition table linluvr Linux - General 7 06-11-2011 06:56 AM
[SOLVED] partition table raw data using fdisk Kap1234 Linux - Newbie 1 05-02-2010 09:14 AM
Restore partition table or recover data Berticus Linux - Hardware 4 03-27-2009 11:49 PM
Can I install RedHat on an existing partition leaving data intact? prcarp Linux - Newbie 1 02-09-2004 08:00 AM
Extract data from disk, without partition table... mandatory Linux - General 1 10-20-2003 06:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration