swap partition disappeared after dist-upgrade

Archived topics about LMDE 1 and LMDE 2
Locked
robertb

swap partition disappeared after dist-upgrade

Post by robertb »

I just noticed that my swap partition disappeared. (Oddly, after the dist-upgrade, my original partition set of an ext3 partition and a swap partition changed into a single ext4 partition.)

This is sorta scary.

What are my options here? Resizing the ext4 partition and adding a swap partition doesn't appeal to me (resizing any ext-based partition seems scary).

Thanks.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
bananas4370

Re: swap partition disappeared after dist-upgrade

Post by bananas4370 »

Resizing scares me too. You could always do this to add a swap file.

Surf to http://www.cyberciti.biz/faq/linux-add- ... ile-howto/

Hope this helps. I had to do this a while ago, and it works very well.

Cheers
Patrick
robertb

Re: swap partition disappeared after dist-upgrade

Post by robertb »

I seemed to have solved it by installing the dphys-swapfile package. It's pretty automatic.

But, I'm still baffled as to why dist-upgrade deleted the swap partition. (Maybe some package desires an ext4 file system initially?) This is especially disconcerting given that I was planning on installing Linux Mint Debian Edition on a dual-boot machine -- I don't want it to wipe out partitions willy-nilly upon its first dist-upgrade.
CiaW

Re: swap partition disappeared after dist-upgrade

Post by CiaW »

I could see where possibly a swap partition was no longer recognized due to a uuid change or something like that, possibly... there were some issues along those lines at one point, as I recall. But the partition was still there, it just wasn't labeled correctly so it wasn't mounted or some similar issue. After I installed straight Debian I had to re-label my swap partition and added the new LABEL to the fstab.

But, to have it disappear and have the file system type change? That's very odd... I can't imagine it would do such a thing without some warning. In the 2 years I've been using linux, I've not heard of that happening willy-nilly.
robertb

Re: swap partition disappeared after dist-upgrade

Post by robertb »

So, if my partition does still exist, how do I find it? I tried sudo parted -l and it just showed a single contiguous partition. See below. Because /etc/fstab had "swap was on /dev/sda2 during installation" in it, I tried looking at /dev/sda2, but it didn't seem to exist.

There was a point during dist-upgrade when grub-pc complained that the UUID of my drive changed. At that point, I agreed to reinstall GRUB since I was afraid of my computer not being able to boot -- that was the only evidence that anything changed.

Code: Select all

% sudo parted -l
Model: ATA SAMSUNG HM250HI (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  250GB  250GB  primary  ext4
CiaW

Re: swap partition disappeared after dist-upgrade

Post by CiaW »

From your output, you're right it appears there's no sda2, or 3+. It's possible something like smartmontools (I think that's the name of the package...) would give you more details. Or something like gparted may be able to create new partition space and re-size your current sda1 down. However before you attempt anything like that, of course you'd want to make sure your important data is backed up, and know there's a possibility that you'd have to re-install. That would be your call, of course.

Or someone who's more expert at this sort of thing may have some input, too.
xircon

Re: swap partition disappeared after dist-upgrade

Post by xircon »

What is the output of:

Code: Select all

sudo fdisk -l
and:

Code: Select all

df -v
robertb

Re: swap partition disappeared after dist-upgrade

Post by robertb »

xircon wrote:What is the output of:

Code: Select all

sudo fdisk -l

Code: Select all

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00076aa2

   Device Boot      Start         End      Blocks   Id  System
 /dev/sda1               1       30337   243673088   83  Linux
xircon wrote:and:

Code: Select all

df -v

Code: Select all

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1            239847968  45269912 182394404  20% /
tmpfs                   508180         0    508180   0% /lib/init/rw
udev                    502540       484    502056   1% /dev
tmpfs                   508180         0    508180   0% /dev/shm
I thought of this yesterday, too. Doing a few cylinder calculations, there is my little slice of partition at the very end (~500MB). I have a http://gparted.sourceforge.net/livecd.php which I will try out and see if I can recover that partition. I guess CiaW was right -- the UUIDs calculations must've changed and that made the swap partition invisible.
xircon

Re: swap partition disappeared after dist-upgrade

Post by xircon »

That is really weird! One partition only. Can't see how any update could do this. I wouldn't mess around, I would back-up my home directory, create a list of installed packages, reformat the drive from a live CD, then reinstall, update, upgrade, reinstall packages and finally reinstate my home directory.
Pranaone

Re: swap partition disappeared after dist-upgrade

Post by Pranaone »

I agree with xircon. But on the bright side, the upgrade saved you some space, which otherwise would have gone waste if it had been allocated as swap.frankly I see no use for swap on modern machines,by that i mean personal computers and not servers.
robertb

Re: swap partition disappeared after dist-upgrade

Post by robertb »

xircon wrote:That is really weird! One partition only. Can't see how any update could do this. I wouldn't mess around, I would back-up my home directory, create a list of installed packages, reformat the drive from a live CD, then reinstall, update, upgrade, reinstall packages and finally reinstate my home directory.
Pranaone wrote:I agree with xircon. But on the bright side, the upgrade saved you some space, which otherwise would have gone waste if it had been allocated as swap.frankly I see no use for swap on modern machines,by that i mean personal computers and not servers.
My machine is working perfectly (with the swap file workaround) and it took me about 20 hours to get everything in its current state. I don't savor the idea of spending another 20 hours to reinstall everything. I'll just use it, do regular back-ups, and let it be.

I'm wondering, 'tho, if I had done things in the wrong order when installing Mint in the first place. I had
  • installed,
  • restored my package list (via dpkg --set-selections),
  • and then upgraded.
It might have been better to
  • install,
  • dist-upgrade,
  • and then install one-by-one (or in batches) packages that I had had originally.
(FWIW, including libraries, I have about 2000 packages installed.) At the very least, I could determine which package was the culprit for changing my primary partition from ext3 into ext4 and possibly which one dropped or changed my swap partition.
Pranaone

Re: swap partition disappeared after dist-upgrade

Post by Pranaone »

:shock: 2000+ packages :shock: the best i got to is 1200 before screwing everything up.. Currently running katya rc.. I hope clem would release an updated snapshot of lmde.
Locked

Return to “LMDE Archive”