Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Resizing a FAT partition?
Date: Thu, 30 Jul 2015 19:26:15
Message-Id: 201507302025.58232.michaelkintzios@gmail.com
In Reply to: Re: [gentoo-user] Resizing a FAT partition? by Todd Goodman
1 On Thursday 30 Jul 2015 20:18:36 Todd Goodman wrote:
2 > * Meino.Cramer@×××.de <Meino.Cramer@×××.de> [150730 14:32]:
3 > > Hi,
4 > >
5 > > I have a SDcard of this layout:
6 > > Number Start End Size Type File system Flags
7 > >
8 > > 1 4194kB 32.0GB 32.0GB primary fat32 lba
9 > >
10 > > There are about 11 GByte of data on it.
11 > >
12 > > The final result should be a SDcard with two partitions.
13 > > First a FAT32 with about 20GByte and a second with 10GByte
14 > > (ext4).
15 > >
16 > > I took a look at parted and the resize command, which sounds
17 > >
18 > > a little cryptic to me:
19 > > resizepart partition end
20 > >
21 > > Change the end position of partition. Note that
22 > > this does not modify any filesystem present in
23 > > the partition.
24 > >
25 > > One should use resize2f for that purpose.
26 > >
27 > > Firstly I want to shrink the first partition and secondly it is a
28 > > plain FAT32 partition not ext-something. I did not find a
29 > > "resizefat32" or similiar.
30 > >
31 > > What tools do I need?
32 > > (beside the way to backup the SDcard, reinitialize it, put 2
33 > > partitions on it and copy back the stuff.)
34 > >
35 > > How can I acchieve what I want?
36 > >
37 > > Thank you very much in advance for any help!
38 > >
39 > > Best regards,
40 > > Meino
41 >
42 > Hi Meino,
43 >
44 > The "difficulty" with shrinking partitions is that you need to shrink
45 > the filesystem in the partition first and then change the partition
46 > information (which you can then do if you're careful with your favorite
47 > partition tool.)
48 >
49 > There are definitely tools to do this and I'm surprised parted says it
50 > doesn't touch the filesystem in the partition (but that might have been
51 > a recent parted change?)
52 >
53 > Personally, since you're going to play around with the partitions and
54 > resizing existing filesystems, you should really have a backup.
55 >
56 > If you're going to have a backup then the easiest thing to me is to
57 > create new partitions and then filesystems and then restore from the
58 > backup.
59 >
60 > However, if you really want to live dangerously, the last gparted boot
61 > disc image I used could shrink FAT32 filesystems and partitions. You
62 > might want to see if it still can do so.
63 >
64 > Good luck!
65 >
66 > Todd
67
68 Don't forget to defrag the filesystem first! If you were making it larger
69 then it wouldn't matter, but if you are shrinking it, then you want your files
70 to be contiguous and not sprayed all over the partition.
71
72 --
73 Regards,
74 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Resizing a FAT partition? Meino.Cramer@×××.de