4
0
When I created my GPT partitions using parted
, I was using ext2
file system type perviously:
$ parted /dev/sdc print | grep ^12
12 961GB 1118GB 157GB ext2 msftdata
Now I want to change it to ext4
instead, so I use mkfs.ext4 /dev/sdc12
to reformat the partition, but when I do a parted /dev/sdc print
as above, it is still showing ext2
as the file system type.
I did some reading and seems that the only way for parted
to touch the file system type is the mkpartfs
command, Ref: http://www.thegeekstuff.com/2011/09/parted-command-examples/. Is that so? I really don't like to use the mkpartfs
command to change my file system type because I don't want to recreate my partition again. That will mess up with my partition numbering (sdc12 will be named as sdc19, for e.g.). Is there any better ways?
EDIT:
Bumped into the same problem again, and found the answer here, again, to my very own question. So, logging why I thought it was necessary to change the partition file system type:
% mount $bootdev
mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
% fsck $bootdev
fsck from util-linux 2.20.1
e2fsck 1.42.8 (20-Jun-2013)
GptLive: clean, 21/1024000 files, 74309/4096000 blocks
% mount $bootdev
mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
I.e., I newly created a /dev/sdb2
entry with type auto
in the /etc/fstab
. However, mount
just can't mount it. However:
% mount $bootdev /mnt/GptLive
% mount | grep $bootdev
/dev/sdb2 on /mnt/GptLive type ext2 (rw)
I.e., when mount $dev
doesn't work, mount $dev /mnt/place
worked just fine.
I don't know why and can't explain the fix, but just logging the fact that this is why I was looking for the solution, and how I "fixed" it.
Thanks
That's more than comprehensive, thanks a million. Yes, in my system, Ubuntu 13.10 Saucy,
parted
was not able to identifying it correctly, but as pointed out,blkid
can. – xpt – 2014-02-10T00:05:48.770