swap partition disappeared after dist-upgrade

Archived topics about LMDE 1
Forum rules
robertb
Level 1
Level 1
Posts: 30
Joined: Sun May 22, 2011 9:36 pm

swap partition disappeared after dist-upgrade

Postby robertb » Sun May 22, 2011 9:51 pm

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.

User avatar
bananas4370
Level 2
Level 2
Posts: 51
Joined: Wed May 19, 2010 6:38 pm
Location: Queensland Australia

Re: swap partition disappeared after dist-upgrade

Postby bananas4370 » Sun May 22, 2011 11:35 pm

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

Surf to http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/

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

Cheers
Patrick
Experience is what causes a person to make new mistakes instead of old ones.

robertb
Level 1
Level 1
Posts: 30
Joined: Sun May 22, 2011 9:36 pm

Re: swap partition disappeared after dist-upgrade

Postby robertb » Mon May 23, 2011 9:54 am

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
Level 3
Level 3
Posts: 170
Joined: Fri Sep 10, 2010 11:39 am
Location: Spokane Wash, USA

Re: swap partition disappeared after dist-upgrade

Postby CiaW » Mon May 23, 2011 10:00 pm

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
Level 1
Level 1
Posts: 30
Joined: Sun May 22, 2011 9:36 pm

Re: swap partition disappeared after dist-upgrade

Postby robertb » Tue May 24, 2011 10:09 am

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
Level 3
Level 3
Posts: 170
Joined: Fri Sep 10, 2010 11:39 am
Location: Spokane Wash, USA

Re: swap partition disappeared after dist-upgrade

Postby CiaW » Tue May 24, 2011 11:01 am

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.

User avatar
xircon
Level 5
Level 5
Posts: 771
Joined: Sun Aug 01, 2010 7:59 am
Location: Sheffield, UK

Re: swap partition disappeared after dist-upgrade

Postby xircon » Tue May 24, 2011 4:40 pm

What is the output of:

Code: Select all

sudo fdisk -l


and:

Code: Select all

df -v
Dell Inspiron N5010 / Core I5 / ATI Mobility Radeon HD5400, LMDE Tracking Sid & Cinnamon Desktop
"Ubuntu is an African word meaning 'I can't configure Debian'"

robertb
Level 1
Level 1
Posts: 30
Joined: Sun May 22, 2011 9:36 pm

Re: swap partition disappeared after dist-upgrade

Postby robertb » Wed May 25, 2011 10:11 am

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.

User avatar
xircon
Level 5
Level 5
Posts: 771
Joined: Sun Aug 01, 2010 7:59 am
Location: Sheffield, UK

Re: swap partition disappeared after dist-upgrade

Postby xircon » Wed May 25, 2011 11:02 am

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.
Dell Inspiron N5010 / Core I5 / ATI Mobility Radeon HD5400, LMDE Tracking Sid & Cinnamon Desktop
"Ubuntu is an African word meaning 'I can't configure Debian'"

User avatar
Pranaone
Level 3
Level 3
Posts: 148
Joined: Fri May 14, 2010 12:50 am
Location: Sri Lanka

Re: swap partition disappeared after dist-upgrade

Postby Pranaone » Thu May 26, 2011 5:48 am

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
Level 1
Level 1
Posts: 30
Joined: Sun May 22, 2011 9:36 pm

Re: swap partition disappeared after dist-upgrade

Postby robertb » Thu May 26, 2011 9:27 am

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.

User avatar
Pranaone
Level 3
Level 3
Posts: 148
Joined: Fri May 14, 2010 12:50 am
Location: Sri Lanka

Re: swap partition disappeared after dist-upgrade

Postby Pranaone » Thu May 26, 2011 10:28 am

: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.


Return to “Archive”

Who is online

Users browsing this forum: No registered users and 14 guests