FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-26-2012, 08:04 AM
Jochen Spieker
 
Default shrink ext3 filesystem using e2fsprogs and fdisk

Martin T:
>
> Is it possible to make partition smaller starting from the beginning?

No.

> If yes, do I need to somehow start file system from the end of the
> partition?

AFAIK that's not possible. The solution for your problem (which involves
initial reformatting) is LVM.

J.
--
There is no justice in road accidents.
[Agree] [Disagree]
<http://www.slowlydownward.com/NODATA/data_enter2.html>
 
Old 03-26-2012, 02:28 PM
Darac Marjal
 
Default shrink ext3 filesystem using e2fsprogs and fdisk

On Sun, Mar 25, 2012 at 10:50:27PM +0000, Martin T wrote:
> I have a 500GB((131072000*4096)/1024^3) ext3 filesystem:
>
[cut]
>
> Is it possible to make partition smaller starting from the beginning?
> If yes, do I need to somehow start file system from the end of the
> partition?

Not directly. Try installing gparted (package: gparted). This will give
you a graphical interface which will allow you to resize the partition
as you're wanting. You will probably become aware that, no, taking space
off the beginning of the partition is not possible, but it IS possible
to take space off the END of the partition and then "slide" the
partition towards the end of the space.

The same is possible (I think) using the CLI parted, if you don't have
X. Note also that ext3 does NOT support online shrinking (you can make
it larger, but to make it smaller you MUST umount it).


--
Darac Marjal


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120326142808.GA18505@darac.org.uk">http://lists.debian.org/20120326142808.GA18505@darac.org.uk
 
Old 03-26-2012, 11:15 PM
Martin T
 
Default shrink ext3 filesystem using e2fsprogs and fdisk

Jochen, Darac:

thanks for replies! Is it possible to "slide" partition using the
tools included with e2fsprogs package as well? Or is the GNU Parted
only option here if I want to make changes over CLI?


regards,
martin

Kuupäeval 26. märts 2012 17:28 kirjutas Darac Marjal <mailinglist@darac.org.uk>:
> On Sun, Mar 25, 2012 at 10:50:27PM +0000, Martin T wrote:
>> I have a 500GB((131072000*4096)/1024^3) ext3 filesystem:
>>
> [cut]
>>
>> Is it possible to make partition smaller starting from the beginning?
>> If yes, do I need to somehow start file system from the end of the
>> partition?
>
> Not directly. Try installing gparted (package: gparted). This will give
> you a graphical interface which will allow you to resize the partition
> as you're wanting. You will probably become aware that, no, taking space
> off the beginning of the partition is not possible, but it IS possible
> to take space off the END of the partition and then "slide" the
> partition towards the end of the space.
>
> The same is possible (I think) using the CLI parted, if you don't have
> X. Note also that ext3 does NOT support online shrinking (you can make
> it larger, but to make it smaller you MUST umount it).
>
>
> --
> Darac Marjal
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/20120326142808.GA18505@darac.org.uk
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAJx5YvEnEV4+xCPZVLm-oH0ZUsgPBDYEK0=xPM7mhOSCKTmqKw@mail.gmail.com">htt p://lists.debian.org/CAJx5YvEnEV4+xCPZVLm-oH0ZUsgPBDYEK0=xPM7mhOSCKTmqKw@mail.gmail.com
 
Old 03-28-2012, 01:49 PM
Stefan Monnier
 
Default shrink ext3 filesystem using e2fsprogs and fdisk

> thanks for replies! Is it possible to "slide" partition using the
> tools included with e2fsprogs package as well?

The e2fsprogs tools only deal with the needs specific to
ext[234] partitions. Sliding a partition can be done for any partition
you like with `dd'.


Stefan


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: jwvehscdefn.fsf-monnier+gmane.linux.debian.user@gnu.org">http://lists.debian.org/jwvehscdefn.fsf-monnier+gmane.linux.debian.user@gnu.org
 
Old 03-28-2012, 11:49 PM
Martin T
 
Default shrink ext3 filesystem using e2fsprogs and fdisk

Stefan:

I'm afraid you can't use dd for this because as far as I know dd(1)
reads and writes one block at a time and in case new position for file
system overlaps with the present one, using dd you will start
overwriting the end of the file system with the readings from the
start of the file system. In addition, both parted and Gparted don't
have dd as a dependency. However, it should be doable if current and
new position don't overlap using the "skip=" and "seek=" options of
dd..or how did you think?


Jochen, Darac:

here is what Gparted did:

========================================

GParted 0.6.2

Libparted 2.3
Move /dev/sda9 to the right and shrink it from 904.37 GiB to 611.40
GiB 06:02:27 ( SUCCESS )

calibrate /dev/sda9 00:00:00 ( SUCCESS )

path: /dev/sda9
start: 56924160
end: 1953523711
size: 1896599552 (904.37 GiB)
check file system on /dev/sda9 for errors and (if possible) fix them
00:02:16 ( SUCCESS )

e2fsck -f -y -v /dev/sda9

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

308 inodes used (0.00%)
18 non-contiguous files (5.8%)
0 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 20/9/0
3363494 blocks used (2.57%)
0 bad blocks
1 large file

169 regular files
130 directories
0 character device files
0 block device files
0 fifos
0 links
0 symbolic links (0 fast symbolic links)
0 sockets
--------
299 files
e2fsck 1.41.12 (17-May-2010)
shrink file system 00:01:31 ( SUCCESS )

resize2fs /dev/sda9 641099775K

Resizing the filesystem on /dev/sda9 to 160274943 (4k) blocks.
The filesystem on /dev/sda9 is now 160274943 blocks long.

resize2fs 1.41.12 (17-May-2010)
shrink partition from 904.37 GiB to 611.40 GiB 00:00:01 ( SUCCESS )

old start: 56924160
old end: 1953523711
old size: 1896599552 (904.37 GiB)
new start: 56924160
new end: 1339123711
new size: 1282199552 (611.40 GiB)
check file system on /dev/sda9 for errors and (if possible) fix them
00:02:47 ( SUCCESS )

e2fsck -f -y -v /dev/sda9

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

308 inodes used (0.00%)
18 non-contiguous files (5.8%)
0 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 20/9/0
3821982 blocks used (2.38%)
0 bad blocks
1 large file

169 regular files
130 directories
0 character device files
0 block device files
0 fifos
0 links
0 symbolic links (0 fast symbolic links)
0 sockets
--------
299 files
e2fsck 1.41.12 (17-May-2010)
grow file system to fill the partition 00:01:03 ( SUCCESS )

resize2fs /dev/sda9

Resizing the filesystem on /dev/sda9 to 160274944 (4k) blocks.
The filesystem on /dev/sda9 is now 160274944 blocks long.

resize2fs 1.41.12 (17-May-2010)
check file system on /dev/sda9 for errors and (if possible) fix them
00:02:46 ( SUCCESS )

e2fsck -f -y -v /dev/sda9

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

308 inodes used (0.00%)
18 non-contiguous files (5.8%)
0 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 20/9/0
3821982 blocks used (2.38%)
0 bad blocks
1 large file

169 regular files
130 directories
0 character device files
0 block device files
0 fifos
0 links
0 symbolic links (0 fast symbolic links)
0 sockets
--------
299 files
e2fsck 1.41.12 (17-May-2010)
grow partition from 611.40 GiB to 904.37 GiB 00:00:02 ( SUCCESS )

old start: 56924160
old end: 1339123711
old size: 1282199552 (611.40 GiB)
new start: 56924160
new end: 1953523711
new size: 1896599552 (904.37 GiB)
move file system to the right 05:48:52 ( SUCCESS )

perform read-only test 01:54:58 ( SUCCESS )

using internal algorithm
read 611.40 GiB
finding optimal block size

read 16.00 MiB using a block size of 2.00 MiB 00:00:00 ( SUCCESS )

16.00 MiB of 16.00 MiB read
0.215304 seconds
read 16.00 MiB using a block size of 4.00 MiB 00:00:00 ( SUCCESS )

16.00 MiB of 16.00 MiB read
0.250469 seconds
read 16.00 MiB using a block size of 8.00 MiB 00:00:01 ( SUCCESS )

16.00 MiB of 16.00 MiB read
0.215766 seconds
read 16.00 MiB using a block size of 16.00 MiB 00:00:00 ( SUCCESS )

16.00 MiB of 16.00 MiB read
0.253064 seconds
optimal block size is 2.00 MiB
read 611.34 GiB using a block size of 2.00 MiB 01:54:57 ( SUCCESS )

611.34 GiB of 611.34 GiB read
611.40 GiB (656486170624 B) read
perform real move 03:53:54 ( SUCCESS )

using internal algorithm
copy 611.40 GiB
finding optimal block size

copy 16.00 MiB using a block size of 1.00 MiB 00:00:01 ( SUCCESS )

16.00 MiB of 16.00 MiB copied
0.988301 seconds
copy 16.00 MiB using a block size of 2.00 MiB 00:00:00 ( SUCCESS )

16.00 MiB of 16.00 MiB copied
0.53326 seconds
copy 16.00 MiB using a block size of 4.00 MiB 00:00:01 ( SUCCESS )

16.00 MiB of 16.00 MiB copied
0.598635 seconds
copy 16.00 MiB using a block size of 8.00 MiB 00:00:01 ( SUCCESS )

16.00 MiB of 16.00 MiB copied
0.530564 seconds
copy 16.00 MiB using a block size of 16.00 MiB 00:00:00 ( SUCCESS )

16.00 MiB of 16.00 MiB copied
0.522437 seconds
optimal block size is 16.00 MiB
copy 611.32 GiB using a block size of 16.00 MiB 03:53:51 ( SUCCESS )

611.32 GiB of 611.32 GiB copied
611.40 GiB (656486170624 B) copied
shrink partition from 904.37 GiB to 611.40 GiB 00:00:02 ( SUCCESS )

old start: 56924160
old end: 1953523711
old size: 1896599552 (904.37 GiB)
new start: 671324160
new end: 1953523711
new size: 1282199552 (611.40 GiB)
check file system on /dev/sda9 for errors and (if possible) fix them
00:03:07 ( SUCCESS )

e2fsck -f -y -v /dev/sda9

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

308 inodes used (0.00%)
18 non-contiguous files (5.8%)
0 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 20/9/0
3821982 blocks used (2.38%)
0 bad blocks
1 large file

169 regular files
130 directories
0 character device files
0 block device files
0 fifos
0 links
0 symbolic links (0 fast symbolic links)
0 sockets
--------
299 files
e2fsck 1.41.12 (17-May-2010)
grow file system to fill the partition 00:00:00 ( SUCCESS )

resize2fs /dev/sda9

resize2fs 1.41.12 (17-May-2010)
The filesystem is already 160274944 blocks long. Nothing to do!

========================================

So looks like for "sliding" the partition, (G)parted uses some sort of
"internal algorithm"? In other words parted or Gparted is definitely
needed for operation like this?


regards,
martin

Kuupäeval 28. märts 2012 13:49 kirjutas Stefan Monnier
<monnier@iro.umontreal.ca>:
>> thanks for replies! Is it possible to "slide" partition using the
>> tools included with e2fsprogs package as well?
>
> The e2fsprogs tools only deal with the needs specific to
> ext[234] partitions. *Sliding a partition can be done for any partition
> you like with `dd'.
>
>
> * * * *Stefan
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/jwvehscdefn.fsf-monnier+gmane.linux.debian.user@gnu.org
>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAJx5YvGoG2q5FZeXK8jS8G6FxK-MvMFnGabwFoFqLSfCgm1mzA@mail.gmail.com">http://lists.debian.org/CAJx5YvGoG2q5FZeXK8jS8G6FxK-MvMFnGabwFoFqLSfCgm1mzA@mail.gmail.com
 

Thread Tools




All times are GMT. The time now is 09:38 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org