Discussion:
Splitting a partition, based on df?
Add Reply
q***@outlook.com
2018-09-22 00:34:09 UTC
Reply
Permalink
Since a disk-partition does not "fill up" like a bottle of liquid;
but rather, deleting files: marks as available, a chain of, possibly
non-consecutive blocks.
So, is it not problematic if I repartition the USBstik from a single
partition to 2-partitions: based on the current `df` ?
man df: df displays the amount of disk space available on the
file system containing each file name argument.
Aragorn
2018-09-22 02:17:19 UTC
Reply
Permalink
On Saturday 22 September 2018 02:34, ***@outlook.com conveyed the
following to alt.os.linux.slackware...
Post by q***@outlook.com
Since a disk-partition does not "fill up" like a bottle of liquid;
but rather, deleting files: marks as available, a chain of, possibly
non-consecutive blocks.
So, is it not problematic if I repartition the USBstik from a single
partition to 2-partitions: based on the current `df` ?
man df: df displays the amount of disk space available on the
file system containing each file name argument.
If you mean "repartitioning a USB stick from one large partition into
two smaller partitions without losing the data present in the original
large partition", then no, you cannot do that.

The filesystem on the partition determines where your files are and how
the operating system can find them. You cannot simply cut a filesystem
in half.

Advice: Back up the data from the stick onto another device, then
repartition the stick, create new filesystems on those partitions, and
then copy back your data.
--
With respect,
= Aragorn =
Grant Taylor
2018-09-22 04:49:15 UTC
Reply
Permalink
Post by Aragorn
If you mean "repartitioning a USB stick from one large partition into
two smaller partitions without losing the data present in the original
large partition", then no, you cannot do that.
Actually, yes you can "repartition a USB stick from one large partition
into two smaller partitions without losing the data present in the
original large partition".

There are a number of utilities that will do exactly that.

gparted, Partition Magic (depending on the file system), Acronis Disk
Director immediately come to mind as examples.

All of those can work with data on the disk. There's also the
possibility of creating an image of the USB stick, erasing the stick and
restoring the image with different parameters. There are MANY utilities
that will do this. Ghost, partimage, Acronis True Image immediately
come to mind as examples.
Post by Aragorn
The filesystem on the partition determines where your files are and how
the operating system can find them. You cannot simply cut a filesystem
in half.
There are actually utilities that can divide file systems with some
files going to one half and other files going to another half. They are
more specialized than the above utilities.

Typically what is done is to shrink the existing file system with all
the files, making free space to create a new partition & file system.
Post by Aragorn
Advice: Back up the data from the stick onto another device,
Backing up is always good advise when messing with file systems. (It's
also good advice period.)
Post by Aragorn
then repartition the stick, create new filesystems on those partitions,
and then copy back your data.
That's the old tried and true way to do it. It's no longer required.
--
Grant. . . .
unix || die
Grant Taylor
2018-09-22 04:51:55 UTC
Reply
Permalink
Post by Grant Taylor
Actually, yes you can "repartition a USB stick from one large partition
into two smaller partitions without losing the data present in the
original large partition".
There are a number of utilities that will do exactly that.
Is resize2fs available as (part of) a Slackware package? You can use it
to shrink an ext{2,3,4} file system. I know that fdisk / cfdisk / ???
usedto come with Slackware when I ran it.

So you should have what you need in Slackware.

Shrink the existing file system smaller than you want it with resize2fs
(or comparable utility), redefine the end of the partition past (larger)
than the file system's new small size, then resize2fs the file system to
fill up to the end of the new end of the partition.
--
Grant. . . .
unix || die
Pascal Hambourg
2018-09-22 09:01:46 UTC
Reply
Permalink
Is resize2fs available as (part of) a Slackware package?  You can use it
to shrink an ext{2,3,4} file system.
Resize2fs should be part of e2fsprogs.
However it is common for USB sticks to contain a FAT filesystem. You can
resize it with gparted (GUI) or fatresize (command line).

Loading...