Unexpected error - disk space?

Leap & KDE desktop. Today received error about tmp being full. This is while attempting to update Mozilla apps.

This is the output of df -h with sda6 being nearly full. sda6 is the system (root) partition.

:~> df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G  276K  3.9G   1% /dev/shm
tmpfs           3.9G  2.1M  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda6        21G   20G   32M 100% /
/dev/sda6        21G   20G   32M 100% /.snapshots
/dev/sda6        21G   20G   32M 100% /var/tmp
/dev/sda6        21G   20G   32M 100% /usr/local
/dev/sda6        21G   20G   32M 100% /var/spool
/dev/sda6        21G   20G   32M 100% /tmp
/dev/sda6        21G   20G   32M 100% /var/opt
/dev/sda6        21G   20G   32M 100% /srv
/dev/sda6        21G   20G   32M 100% /var/log
/dev/sda6        21G   20G   32M 100% /var/lib/libvirt/images
/dev/sda6        21G   20G   32M 100% /var/lib/pgsql
/dev/sda6        21G   20G   32M 100% /var/lib/named
/dev/sda6        21G   20G   32M 100% /var/crash
/dev/sda6        21G   20G   32M 100% /var/lib/mariadb
/dev/sda6        21G   20G   32M 100% /var/lib/mailman
/dev/sda6        21G   20G   32M 100% /var/lib/mysql
/dev/sda6        21G   20G   32M 100% /opt
/dev/sda6        21G   20G   32M 100% /boot/grub2/x86_64-efi
/dev/sda6        21G   20G   32M 100% /boot/grub2/i386-pc
/dev/sda7       890G  450G  439G  51% /home

I note that I have 20+ snapshots and presume I can safely remove some, if not most of them. I see that in YaST I can use snapper to do this, is that the proper course of action? How many, or how far back should I keep?

Should I consider enlarging sda6? The size was the recommendation when I installed Leap. Is there a safe way to resize after I back up /home (sda7)? Or will I need to reformat & reinstall? I have never fooled with partitioning tools in Linux.

Thanks, Jon

Yes, you can remove snapshots to get more space. How far back you keep them is up to you.

Should I consider enlarging sda6? The size was the recommendation when I installed Leap.

The recommended size for the BTRFS file system is 40-Gig for root, especially if snapshots are enabled. You have only 21-Gig for root.

Is there a safe way to resize after I back up /home (sda7)? Or will I need to reformat & reinstall? I have never fooled with partitioning tools in Linux.

To answer that, I would need the output from:

gdisk -l /dev/sda
parted -l
fdisk -l
:~ # gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. 
***************************************************************

Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): FB5D7C41-0571-43DE-8835-ECBF24B42F9E
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 8-sector boundaries
Total free space is 29671 sectors (14.5 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              63           80324   39.2 MiB    0700  Microsoft basic data
   5           83968        16883711   8.0 GiB     8200  Linux swap
   6        16885760        58830847   20.0 GiB    8300  Linux filesystem
   7        58832896      1953503231   903.4 GiB   8300  Linux filesystem

:~ # parted -l
Model: ATA ST31000524AS (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system     Flags
 1      32.3kB  41.1MB  41.1MB  primary   fat16           hidden, type=16
 2      41.9MB  1000GB  1000GB  extended                  boot, lba, type=0f
 5      43.0MB  8644MB  8601MB  logical   linux-swap(v1)  type=82
 6      8646MB  30.1GB  21.5GB  logical   btrfs           type=83
 7      30.1GB  1000GB  970GB   logical   ext4            type=83

:~ # fdisk -l

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 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: 0xf44763df

Device     Boot    Start        End    Sectors   Size Id Type
/dev/sda1             63      80324      80262  39.2M 16 Hidden FAT16
/dev/sda2  *       81920 1953523711 1953441792 931.5G  f W95 Ext'd (LBA)
/dev/sda5          83968   16883711   16799744     8G 82 Linux swap / Solaris
/dev/sda6       16885760   58830847   41945088    20G 83 Linux
/dev/sda7       58832896 1953503231 1894670336 903.5G 83 Linux

This computer originally contained openSuse v11.x upgraded to v12.1 and now a fresh install of Leap. Have no idea why MBR still shows original Dell preload FAT, I never installed the preloaded win image. Guess I didn’t format it when I first installed openSuse.

Thanks for the quick reply. I’ll start by removing some snapshots to give me some wiggle room.

Okay, what I get from this is that you are still using the legacy MBR / Dos partitioning, which is okay.

However, you have all of Linux in Logical partitions in an Extended partition, not really a good layout to begin with, as the only other Primary (Extended is a special case of a Primary partition) is the Hidden Factory Restore.

If you are willing to spend a bit of time, you could make things a lot better by repartitioning the disk and re-installing Leap.

To do so, I recommend:

  1. Back up the drive using Clonezilla;
  2. Get rid of the hidden partition, since you do not need – and say you do not want – it;
  3. Create a Primary root (/) partition of about 40-Gig or more, formatted to BTRFS;
  4. Create a Primary /home partition, make certain it is larger than the current size of sda7, ie: larger than 903.5-Gig, formatted to ext4;
  5. Restore sda7 to the new /home partition (I will tell you how to do that when you reach that stage) using Clonezilla; and
  6. Re-install Leap as Legacy using Custom Partitioning (I will guide you with this when you are ready for this stage).

Are you willing? If so, I (and/or others here) will guide you with each step to make certain you get where you want.

Of course, the initial backup is very important in case anything blows up on you, and the sda7 portion of that backup is prime importance. I am presuming (hoping?) you have an external drive of some sort to back up to.

#3 & 4 puzzles me. They add to 943 Gig, a bit larger than what I see in the numbers available to me.

Are you willing? If so, I (and/or others here) will guide you with each step to make certain you get where you want.

Of course, the initial backup is very important in case anything blows up on you, and the sda7 portion of that backup is prime importance. I am presuming (hoping?) you have an external drive of some sort to back up to.

I obviously need to do this, but not this week. I need to make sure I have all my ducks in a row, including making sure I have my IRS tax return completed before I will feel comfortable risking the possibility that things may go sour. Probably be more than a month before I get to that point.

I do have a 1.5TB usb drive that is formatted NTFS (which I could change if needed). I guess Clonezilla will need to wipe the existing data on that drive, or does it create an image file which would allow me to keep the existing contents of the usb drive?

Actually, if you note, each output gives a different result for the numbers. This is because of the different ways people count Gs, in the output you will see there is GB and there is GiB

But, basically, all three ignore the Hidden partition when they tell you the overall size of the drive in their respective measurements. You have a 1TB internal drive, correct?

All numbers are approximate rounding to give a start plan for what will be done.

But, you are right, I will need to look more closely at it while you are herding your duck team. I see, looking again, the the hidden partition is only 40 Megs, when I had mistaken it for 40-Gig on fast reading. When you are ready to go, let me know, and I will be submitting a slightly altered plan for you. You could PM me to let me know when you are back, but we will continue the work in this thread so others can follow and learn from it.

I obviously need to do this, but not this week. I need to make sure I have all my ducks in a row, including making sure I have my IRS tax return completed before I will feel comfortable risking the possibility that things may go sour. Probably be more than a month before I get to that point.

Oh, good. I am working with someone who first stops to think, then closes his eyes and jumps!lol!

Good choice, I will wait.

I do have a 1.5TB usb drive that is formatted NTFS (which I could change if needed). I guess Clonezilla will need to wipe the existing data on that drive, or does it create an image file which would allow me to keep the existing contents of the usb drive?

Yes, Clonezilla creates image files, so you will simply be saving the image, in compacted form, on that external drive without affecting the data already there. The altered plan might be to adjust that NTFS partition and add a 2nd ext4 partition to that external, though, depending on our next discussions.

Gerry:

I’m ready to proceed with reconfiguring my drive. Reviewing, I have a hidden FAT16 partition that I don’t need, and the drive currently has an extended partition that contain swap, root, & home partitions.

I’ve backed up root (btrfs) & home (ext4) using luckyBackup, to make an individual backup of each partition to a recently purchased 4TB usb drive formatted to ext4. But I am concerned that the permissions and possibly metadata may not carry over backing up btrfs to ext4. Thus I wonder if restoring from luckyBackup is even doable.

I’ve never seen clonezilla. What I see at their site is “The destination partition must be equal or larger than the source one.” Since my drive will be reconfigured to increase the size of the root partition, it will decrease the size of my home partition. Thus the above statement has me wondering if clonezilla can be used to restore my home partition. I’m further confused by the statement at clonezilla site “clonezilla saves and restores only used blocks in the harddisk”, implying that perhaps an image of a half-full partition may indeed fit onto a new partition that is slightly smaller than original. Unless the image contains partition table info, then I guess there is no way.

While it makes sense to do a fresh install, there are a lot of little details, some which I may not remember, that may break a restored home directory. There are a number of files in root that I can simply restore: .conf files, hosts, cron jobs. But there are files that contain authentication info and perhaps network settings that may be difficult to recreate in a fresh install.

I will download clonezilla and make individual backups of root (sda6) & home (sda7) and have them available, in addition to the same for luckyBackup.

Rgds, Jon

Is this EFI boot you do need the FAT partition to boot.

AFAIK, you do not have the current installation installed as UEFI, correct? Because, if so, gogalthorp makes a good point.

Can you verify? We need to know that when we proceed later.

I don’t know. Seems I saw something in bios, I’ll look there. Since first partition is hidden FAT I assume it is a regular installation. The drive was a Win-8 pre-install that I never ran, I repartitioned & reformatted. I kept the FAT to c.y.a. In case things didn’t work out for me.

In bios boot choices are legacy & UEFI. Mine is set to legacy.

In kinfo, sda shows unknown file system, volume usage is partition table, & UUID is unknown.

gParted did not show any specific info about EFI/UEFI.

Yes, check in the BIOS just in case. However, because the first partition is a hidden partition, and because it is not flagged as the boot partition, I also think you have just a straight legacy install.

First order of business. I am assuming you have all backed up with Clonezilla, now. If not, get that done before this next step:

Boot with your GParted boot disk, use it to shrink sda7 (your /home & data partition) to 700-Gb. This will give us plenty of spare room to play with.

When the shrink operation has finished, boot with the openSUSE install disk, go to the rescue console and log in as root. For any followers who do not already know this, just hit enter if prompted for the password – it is blank.

For safety sake, we need to check the partition we just shrank. In this case, it is sda7, so do:

fsck /dev/sda7

If any errors are found, allow the fsck fix.

Once verified error free, boot with Clonezilla and make another backup of the smaller /home partition (create partition image rather than whole disk image). This is the backup we will restore from later in the process.

Next step is in my next post.

Launch GParted again, use it to delete all partitions on the drive.

Apply all deletions.

Create a new partition table: Under the device menu, choose Create Partition Table …

In there, in your case, choose to create an MSDos partition table, and apply.

Now, just to make sure all things are cleared from memory, I personally like to shut down the machine, then cold boot with GParted again.

Now, create an 8-Gig Linux Swap partition as the first Primary partition. Make certain you choose Alignment and set it to MiB alignment.

Leave approximately 1-Gb at the start of the drive so that your swap runs from the 1-G point to about the 9-G point. This extra blank space at the front of the disk will leave you with more flexibility for future changes that might be desired down the road, and you will not miss the unallocated 1-Gb in the meantime. On that drive, it is a mere drop in the bucket.

Make sure all changes to here are applied.

Now, create a 40-Gb Primary partition, format it to btrfs, since this is what you have been using in your current install.

(NOTE: You could make that a 50 or 60-Gb, if you would rather. It does not matter as long as the remaining unallocated space is larger than 700-Gb. This remaining space must be as large or larger than what we shrank the /home partition to.)

Once all changes have been applied to create this second partition, which will be the root partition:

Now, create a 3rd Primary partition in the unallocated space, format it to ext4.

Apply all changes.

And one last step while still in GParted:

Set the boot flag on the root (2nd) Primary partition and Apply.

Close GParted and shut the machine down: It is now Clonezilla Time!

First, before actually booting Clonezilla, we need to make a few changes to the Clonezilla backup files.

If you have another PC with Linux on it, you can connect your backup drive to it. If not, use any one of your live Linux cd/dvds. (You have one, right? It is not necessary to have the same version, or even the same brand of Linux as Leap. We are merely going to use the GUI – the easiest way – to change a few files in the backup.)

Navigate to the Clonezilla backup you made of the root partition.

The root partition was sda6, but we now want to restore it to sda2.

So:

In the list of files, find the file parts and open it with your file editor. In that file, change “sda6” to “sda2” and save the changes.

In the same list of files, you will see files with names similar to this:

sda6.ext4-ptcl-img.gz.aa

So, now, every file in this directory that starts with “sda6” should be renamed to start with “sda2”.

You can do the equivalent changes in the backup we just made of the shrunken /home partition at this time, as well:

For the shrunken /home partition, we will be restoring the sda7 to sda3, so make similar changes as above, but this time you will change “sda7” in parts to “sda3” and all filenames that start with “sda7” to instead start with “sda3”.

Now, boot with Clonezilla.

When you get to this menu:

savedisk          Save_local_disk_as_an_image
saveparts         Save_local_partitions_as_an_image
...
[i][b](etc.)[/b][/i]

you will choose the restoreparts option.

Of course, you will choose to restore the sda2 partition from the root backup directory.

When you get to the mode menu, Instead of Beginner Beginner mode: Accept the default actions

choose Expert mode

At the Advanced Parameters screen, you will use the spacebar to deselect all items and to only select:
! You do not want to “Reinstall grub” this way, so deselect it.

You want to select:


[li] -c Client waits for confirmation before cloning
[/li]

[li] -t Client does not restore the MBR (Master Boot Record)
[/li]

[li] -r Try to resize the filesystem to fit partition size
[/li]

[li] -j2 Clone the hidden data between MBR and 1st partition
[/li]
When you get to the menu creating partition tables:

DO NOT choose to Use the partition table from the image

INSTEAD, choose:
-k Do NOT create a partition table on the target disk

Once this is done for the root partition (now sda2), you will want to run Clonezilla again. Easiest and safest? Shut the machine down, then cold boot again with Clonezilla.

Repeat the above steps to restore your home partition (now sda3), using all the same parameters.

DO NOT TRY TO BOOT YOUR RESTORED MACHINE YET, though, because we first will have to change some mount points.

When you have reached this stage, let me know, and we will continue.

Some comments here.

I had a lot of difficulty with the video driver of the Live CD. I was unable to read the text in the GUI. I wasted plenty of time rebooting, trying different resolutions. And on my first try at editing the filenames, I had opened the USB drive in dolphin and it refused to save. Probably due to not running dolphin in super user mode, although I was logged in as root. Oh well, it worked when I opened in SU.

The other thing is that my original sda7 has 84 files that I needed to rename. I probably could have done it at the cmdline quite simply but I didn’t want to risk screwing up the backup. Next time I will figure out how to do this in the terminal.

When you get to the mode menu, Instead of Beginner Beginner mode: Accept the default actions

choose Expert mode

Just for the record, this option selection comes several screens earlier in the selection process, reading down a list of steps, gotta know you will be using Expert mode.

When you get to the menu creating partition tables:

DO NOT choose to Use the partition table from the image

INSTEAD, choose:
-k Do NOT create a partition table on the target disk

This one was particularly tricky for me. Within the program, some of the parameter selections are made with ‘*’, some are meant to highlight with the cursor and press Enter. The -k option is one of those, where there are several selections, including -k, and I read it as being already selected so I chose Enter without highlighting, not realizing that this was not selecting -k. Fortunately I caught that error a few screens later on the confirmations & warnings. It’s all due to my lack of familiarity with clonezilla.

rename 7 3 sda7*.*

or

rename sda7 sda3 sda7*.*

:wink:

Okay, I assume you are now ready to fix the mount points.

Just in case we are lucky, let us see if we can do things easily.

Can you boot and see if you get to the Grub menu?

If you can get there, it will save some work. At the Grub menu, tap the “e” key for edit mode.

In there, go to the beginning of the line that starts with “linux” then hit the “End” key, which will place you at the very end of that command line. Add a space and then a 3 and hit F10. That should boot you to the console, where you can log in as root.

Let me know if you get that far.

If there is no Grub menu when you attempt to boot, we will need to take a few extra steps.

No deal. I get a constant rapid beep from the bios (no bootable devoce?)

Meanwhile I’ve loaded install DVD in rescue mode, logged in as root.

jon

For anyone following this thread, here is what – in this particular case – will need to be done if the machine does not yet boot to the Grub menu:

You will need to re-install Grub using the correct install DVD. Since this is Leap, it will be necessary to use the same Leap install DVD.

Boot with the install DVD, but, do not click on Install.

Instead, 3rd item down (AFAIR) should be “Rescue System”. Click on that and wait for it to load.

It will stop with the line

Rescue login:

Type (without the quotes) “root” then press Enter.

You will now see the prompt, probably in a red font:

Rescue:~#

Do:

fdisk -l

just to make certain that the root partition is now sda2.

We need to mount root. Assuming that it is sda2, do:

mount /dev/sda2 /mnt

Mount the other devices next with:

mount --bind /dev /mnt/dev

We then need to chroot from the Rescue root to the installed root, so do:

chroot /mnt
mount -t proc proc /proc
mount -t sysfs sysfs /sys

Then we need to remake Grub, so do:

grub2-mkconfig -o /boot/grub2/grub.cfg

Now we will install Grub to the root partition (sda2, in this case. Make sure you change that appropriately if your root is in a different partition than sda2), so do:

grub2-install /dev/sda2

Now, we can exit and reboot, so do:

exit
reboot

At the Grub menu, hit the “e” key, follow the instructions in the previous post to boot with the “3” option to the console, and log in as root.

We are now ready to fix the mount points, in my next post.

When I do this command I get a lot of errors ‘bad tree block start’ with I assume inode or sector numbers listed.
Also error failing to connect to lvmetad.socket and msg that it is falling back to internal scanning.

I took a photo of screen and can put it up on susepaste (I think) if you wish to look it over.

The 20 lines of error msgs ends with ‘done’, I hope that means I can proceed.

However I am waiting your comment prior to moving on to command.