Root out of space

On 2015-06-02 16:46, Stan Ice wrote:



>   linux-y70s:~ # fdisk -l
>
>
>   Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
>   Units: sectors of 1 * 512 = 512 bytes
>   Sector size (logical/physical): 512 bytes / 512 bytes
>   I/O size (minimum/optimal): 512 bytes / 512 bytes
>   Disklabel type: dos
>   Disk identifier: 0xaae439ed
>
>
>   Device     Boot     Start       End   Sectors   Size Id Type
>   /dev/sda1            2048   3074047   3072000   1.5G 12 Compaq diagnostics
>   /dev/sda2         3074048 453954337 450880290   215G  7 HPFS/NTFS/exFAT
>   /dev/sda3  *    453955582 833443607 379488026   181G  f W95 Ext'd (LBA)
>   /dev/sda4       951261184 976773119  25511936  12.2G 17 Hidden HPFS/NTFS
>   /dev/sda5       479961088 498513014  18551927   8.9G 82 Linux swap / Solaris
>   /dev/sda6       498513078 540474794  41961717    20G 83 Linux
>   /dev/sda7       540474858 833443607 292968750 139.7G 83 Linux
>   /dev/sda8       453955584 479961087  26005504  12.4G 83 Linux


Ok, so it appears you have free sectors from 833443607 to 951261184, and
it is outside sda3, the extended partition. You have to put that inside,
ie, enlarge sda3. Some partitioners will do this automatically as soon
as you try to create a logical partition (sda9).

I’m unsure what software to recommend. I think that it is possible to do
it with fdisk, but it is scary and somewhat dangerous:

print the table above.
Delete sda5…8
delete sda3
recreate sda3 taking all the available free space
recreate sda5…8 with the exact same sector numbers.
Create new sda9 with the rest.

If the numbers match (this is crucial), then enter “w” to write, if not,
“q” to abort.

All your existing partitions should be intact, which can be proven by
rebooting. You then need to format, ie, create a filesystem in sda9.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

I’m not sure I can do all these steps from openSUSE. KDE partition manager shows a lock sign on sda3 and all options are greyed out, apparently because it has mounted partitions on it. Would it be possible to enlarge sda3 while in Windows? Am I right that it should be possible from GParted?

Tomorrow I’ll go and get some blank DVDs to burn GParted and openSUSE (which flavor is best for recovery? Install DVD of live CD?). Unfortunately this laptop doesn’t boot from usb.

I think it would be a safer option than recreating partition table with the system running off the same partition, if it’s even possible.

Do I really have to delete and recreate all the partitions, manually type start and end of each one, and hope that new table matches existing files exactly? It sounds scary.

On 2015-06-02 17:46, Stan Ice wrote:
>
> robin_listas;2713279 Wrote:
>> On 2015-06-02 16:46, Stan Ice wrote:
>>
>> Delete sda5…8
>> delete sda3
>> recreate sda3 taking all the available free space
>> recreate sda5…8 with the exact same sector numbers.
>> Create new sda9 with the rest.
>>
>
> I’m not sure I can do all these steps from openSUSE.

Certainly not! It has to be done from a rescue system.
And the lock is because you are not root.

> Am I right that it should be possible
> from GParted?

No.

The steps I described are only for fdisk, or a tool that allows you to
specify an exact number of sectors. Not a graphical tool.

And please remember that what I described is dangerous. Do it wrong, and
your computer is no more. I have done it, it is pretty safe if you
understand what you do. You really have to understand the process.

Please wait to see if somebody else knows an easier, automatic, way of
enlarging the extended partition.

>
> Tomorrow I’ll go and get some blank DVDs to burn GParted and openSUSE
> (which flavor is best for recovery? Install DVD of live CD?).
> Unfortunately this laptop doesn’t boot from usb.

XFCE rescue CD from openSUSE download page. Extras.

> Do I really have to delete and recreate all the partitions, manually
> type start and end of each one, and hope that new table matches existing
> files exactly? It sounds scary.

It is scary, but if the sector numbers are not changed, it is safe.
Files are not changed, there is no formatting. And you can abort.

The danger is in writing the wrong number of sectors in the table. Even
then, after writing them, you can redo. Nothing is damaged till an
operating system tries to read the files, thinks there is an error, and
tries to repair. Results are horrible.

That’s why I say better wait for other suggestions. Maybe there is some
other tool. Maybe in parted or yast you can simply “add new logical
partition” and it works.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

I still say find what i using up space and fix that.

here is my space usage


gogalthorp@linux:~> df
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/sda1       30829564   7934596  21305876  28% /
devtmpfs         4053224         8   4053216   1% /dev
tmpfs            4094420       772   4093648   1% /dev/shm
tmpfs            4094420      2756   4091664   1% /run
tmpfs            4094420         0   4094420   0% /sys/fs/cgroup
/dev/sdb6      313368112 130778216 166648684  44% /home
/dev/sdb3      103085876  39624592  58201688  41% /vm



the lock is because you are not root.

Partition manager asks for the password, and starting it from su - still shows the lock.

The steps I described are only for fdisk, or a tool that allows you to
specify an exact number of sectors. Not a graphical tool.

In the same KDE Partition manager start and last sectors can be set from the advanced menu for resize of an unlocked/umounted partition. I believe the same option exists in GParted, but it’s not there in YAST partitioner module. I suppose fdisk can be run from a rescue DVD but I’ve never used it beyond fdisk -l.

The danger is in writing the wrong number of sectors in the table. Even
then, after writing them, you can redo. Nothing is damaged till an
operating system tries to read the files, thinks there is an error, and
tries to repair. Results are horrible.

This is somewhat comforting, but this means there’s no way to know for sure until system tries to boot and repair what it thinks is wrong. Is it possible to read files while in rescue DVD first and see if there are any errors due to bad partitioning table? Can I run file system check, for example, to see if it picks up anything?

I still say find what i using up space and fix that.

I don’t know what else to try. Nothing stands out, there doesn’t seem to be a single culprit.

On one of my other machines root takes 13GB out of 20 after a year of use.

That is my point you must have some huge stuff or are using some special databases or tmp space is not being release or something unless you just install every program you can find.

Do you have any programs that manage multimedia files?? Those databases can take up huge amounts of space and could be directed to use other partitions.

On 2015-06-02 19:06, Stan Ice wrote:

> In the same KDE Partition manager start and last sectors can be set from
> the advanced menu for resize of an unlocked/umounted partition. I
> believe the same option exists in GParted, but it’s not there in YAST
> partitioner module. I suppose fdisk can be run from a rescue DVD but
> I’ve never used it beyond fdisk -l.

Just try in gparted or yast to “add new logical partition”. This is
safe, if it accepts it.

Behinds the scenes, it does the same as I described in fdisk. But being
a computer who takes the decisions, it can’t go wrong⁽™⁾ :slight_smile:

And before any of that, find out where the space is going, because it
would make any steps easier, and not urgent.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

I have the usual - Amarok, VLC, and a couple of front ends for mplayer. I hardly have any music so Amarok’s database can’t be huge.

I used to have Plex here, however, and it might have stored data about all media I’ve ever accessed on network drives, those can go be in terabytes and resulting Plex database can also be big.

Hmm, where do I look for those things. Plex was notoriously difficult to get rid off and I’m not sure but it still might start its service even now.

Will try as soon as I boot from external source.

However, I must have missed it in the previous posts but it seems I can’t add another partition to sda3 because it already hosts four. Where should sda9 go? Or should I change sda3 from “extended” to something else without four partitions restriction?

On 2015-06-02 21:06, Stan Ice wrote:

> I used to have Plex here, however, and it might have stored data about
> all media I’ve ever accessed on network drives, those can go be in
> terabytes and resulting Plex database can also be big.
>
> Hmm, where do I look for those things. Plex was notoriously difficult to
> get rid off and I’m not sure but it still might start its service even
> now.

Ha! Yes, somebody had that problem recently. Root partition full. I
think the default store went to /var/lib/plex/ or similar, and that
place ws configurable in a file under /etc/.

Certainly, search for it.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Carlos E. R. donned his tin foil hat and penned:

> Ha! Yes, somebody had that problem recently. Root partition full. I
> think the default store went to /var/lib/plex/ or similar, and that
> place ws configurable in a file under /etc/.
>
> Certainly, search for it.
>

Spot on Carlos ( sorry for late reply had to go to do some work <Spit!> )
yes there is a thread here about “plex” leaving huge amounts of data spread
all over the place and it was only last week if I remember right.

Unfortunately ( fortunately ??? ) I have not had experience of using this
piece of software :slight_smile:

Being a nntp user not via the web it does make it a bit harder to search
though so I will leave it up to Stan :wink:


Mark
Nullus in verba
Caveat emptor
Nil illigitimi carborundum

On 2015-06-03 09:52, Baskitcaise wrote:
> Carlos E. R. donned his tin foil hat and penned:

> Being a nntp user not via the web it does make it a bit harder to search
> though so I will leave it up to Stan :wink:

I can do searches, on my local leafnode server. Via grep on
“/var/spool/news/opensuse/org/help/applications”, assuming it is that
group. It is about 15000 files currently.

nntp clients can not search on body, because it means retrieving them.
Not impossible, because the same client (thunderbird) does body search
on imap. Maybe because there are many more posts on nntp.

…]

Ok, not in applications. Lets try login. Yep, instant hit:

Subject: Re: Resize root partion on runing system?
Date: Thu, 29 May 2014 05:17:52 GMT

Hum, not the recent one.

This one:

Subject: Re: /tmp Is Out Of Disc Space
Date: Thu, 28 May 2015 13:16:02 GMT


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

So, plex.

According to official uninstall guide /var/lib/plexmediaserver needs to be removed manually, which I now did, but it was only 221MB so it didn’t solve my problem.

Now I have 13GB /usr 2.4GB/var and 2GB /lib, together they take almost all space on my 20GB drive. These numbers are big but not ourtrageously so. I suspect all those “additional XX MB space will be used” update messages finally took their toll.

Got Gparted, it looks like I can resize my sda3 extended partition with all the Linux stuff on it to cover unpartitioned space. I hope there won’t be a problem with adding a fifth partition to it to host new /usr.

OTOH, I can also move /home to the end and make free space in front of it to resize root, or even to stick extra partition for /usr there instead.

It is not the application it is the data it accumulates. In general uninstalling a program does not remove the data. Don’t know plex so can’t say were it stashes the data

On 2015-06-03 19:06, gogalthorp wrote:
>
> It is not the application it is the data it accumulates. In general
> uninstalling a program does not remove the data. Don’t know plex so
> can’t say were it stashes the data

“/var/lib/plexmediaserver”, but his /var is normal sized.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

On 2015-06-03 15:16, Stan Ice wrote:
>
> So, plex.
>
> According to official uninstall guide /var/lib/plexmediaserver needs to
> be removed manually, which I now did, but it was only 221MB so it didn’t
> solve my problem.

Pity

> Now I have 13GB /usr 2.4GB/var and 2GB /lib, together they take almost
> all space on my 20GB drive. These numbers are big but not ourtrageously
> so. I suspect all those “additional XX MB space will be used” update
> messages finally took their toll.

Yes.

> Got Gparted, it looks like I can resize my sda3 extended partition with
> all the Linux stuff on it to cover unpartitioned space. I hope there
> won’t be a problem with adding a fifth partition to it to host new /usr.

Ok…

> OTOH, I can also move /home to the end and make free space in front of
> it to resize root, or even to stick extra partition for /usr there
> instead.

Moving home to expand root is the most interesting option, but before
doing that kind of operation you must do a full backup of the affected
partitions, in case the move goes bad.

Otherwise, creating a /usr partition where the free space is right now
is by far the easiest and safest. It is what I would do.

Just remember to prepare the opensuse xfce rescue cd/usb in advance


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

The approach described in these most recent posts should be done in order

  • Clear emty space somewhere… Might be by cloning to a larger virtual drive file like what I described in my earlier post or shrinking some existing partition (which IMO is short sighted possibly leading to other future problems)
  • Depending on where your empty, unpartitioned and unformatted space is, decide what needs to be done to preserve the order of the existing partitions on your disk. This likely means moving or re-arranging so that the empty space is adjacent to the partition you want to expand, and most likely following. If you insert a new partition that changes order or actually move partitions into a different order, you’ll likely need to make changes in your /etc/fstab depending on how the partitions are identified. To ensure maximum ease of mind and zero extra work, just preserve the order of your existing partitions for all scenarios.
  • Once you have done whatever is necessary for your new, empty unpartitioned and/or unformatted space to be adjacent to the partition you want to expand (in your case the root partition), you can now execute expanding into your empty space.

The above approach should be followed no matter what partitioning tool you use, including gparted.

Another hint/recommendation:
When you’re manipulating sizes and location of partitions or changing the sizes of diskfiles, it’s usually a big time saver to zero empty space (if large amounts of empty space is involved in any partition). Else, invisible and deleted files may still leave a “ghost” that is just more data to be moved/manipulated.
And, of course does it need to be said to empty your trash before you even start zero-ing?

If someone doesn’t know how to “dd” to zero out their empty space, post. There are fast and slow ways to do it, too.

IMO,
TSU

I can back up home on an external drive. This drive is ext3 so I suppose all permissions will stay unchanged and I should have no problems even if I reformat partition with /home and then copy it back. Expanding root to the right is relatively safe, isn’t it?

Adding a partition for /usr elsewhere is the safest, true, but also somewhat wasteful - it will free up 13 GB on root and take another 20 GB for itself (I think 20 GB is enough).

First attempt at burning rescue DVD failed, will try again. And I hope openSUSE-13.2-Rescue-CD-x86_64.iso is the one you mean, it doesn’t specify it has Xfce for desktop, though. Also, it’s rescue CD - could there be a problem with burning it to DVD instead? Gparted didn’t complain when put on DVD.

Finally, before moving stuff, what’s the best way to check all my partitions for errors first?

Have done these operations using gparted many times on many machines with many different disk formats and partition layouts for more than a decade now.
Although it’s always prudent to back up anything that’s critical and painful if lost, I’ve not once experienced a problem with loss of data. The only errors I’ve seen essentially were “stops” which simply means that no changes were applied to the disks and no recovery was necessary.

As for your specific Q
As I described in my latest post above, yes you want to maneuver your empty, unpartitioned space to just right of the partition you want to expand into. Other partition layouts might be possible, but not always universally supported. Why introduce something into your system that even if it works today might cause a problem in the future?

Don’t create a new mount point unless there is purpose and reason behind it. Besides complicating your layout, it becomes unconventional and becomes an important unique issue to be described if you ever ask for support again. And, as I have described multiple times above and in my prior post, it may screw up your fstab and then require some modification. All unnecessary and can be avoided.

IMO,
TSU

On 2015-06-03 20:16, Stan Ice wrote:

> I can back up home on an external drive. This drive is ext3 so I suppose
> all permissions will stay unchanged and I should have no problems even
> if I reformat partition with /home and then copy it back.

Right.

> Expanding root
> to the right is relatively safe, isn’t it?

Yes, but don’t rely on it.

> Adding a partition for /usr elsewhere is the safest, true, but also
> somewhat wasteful - it will free up 13 GB on root and take another 20 GB
> for itself (I think 20 GB is enough).

Yes, but you can create a directory in there and use it to store things
from /home - another indirection :wink:

>
> First attempt at burning rescue DVD failed, will try again. And I hope
> openSUSE-13.2-Rescue-CD-x86_64.iso is the one you mean, it doesn’t
> specify it has Xfce for desktop, though.

Yes, there is only one. 32/64 bit, that’s all.

> Also, it’s rescue CD - could
> there be a problem with burning it to DVD instead? Gparted didn’t
> complain when put on DVD.

It’s fine.
A waste, but I don’t think I have any CD around when I want it…

> Finally, before moving stuff, what’s the best way to check all my
> partitions for errors first?

fsck. Depending on the filesystem, there are different options to tell
it to do a forced/thoroughly check.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Tsu, you posted your reply as I was typing mine so I didn’t see your post.

Your advice goes against the suggestion to move /usr out of root and into a new partition elsewhere, which will require a new partition table and changes to fstab.

Simply resizing extended partition hosting all Linux stuff and then moving things to the right to create some more space for root won’t affect order of the partitions and fstab will be left as it is. Root won’t need to be moved either, just /home.

At this point I think this is what I will do.

Practical questions - how to prepare partitions for all that work.

How to check them for errors? Should “fdisk -t ext4 sda4” be enough? I suppose I can run this either from rescue CD or from Gparted.

Would it automatically fix the errors, or should I see what the errors are first?

And yes, I’d like to know how to properly zero empty space, never thought about it but ghost files could complicate things when moving /home. Is it also possible that some empty space is unreported?