How to increase the size of /dev/sda2 in SUSE running on VMware?
Solution 1
Make sure that you have parted
version 3.2, then run parted /dev/sda
and use the resizepart
command to resize sda2, moving the end of the partition to the end of the disk. Then run resize2fs /dev/sda2
to enlarge the filesystem to use the additional space. Reboot not required.
Solution 2
1) Boot this virtual machine from livecd.iso of any distr (example ubuntu)
2) find disk what you want resize (probably /dev/sda)
3) fdisk /dev/sda
d - remove partition
2 - number partition
n - create new
p - type primary
2 - number
2056192 - start on same block, that started deleted partition
<press enter to save default value> - max avaible size
w - write changes and exit
4) after that resize you filesystem with resize2fs /dev/sda2
or other utils (depends your filesystem. resize2fs - for ext2/3/4)
Related videos on Youtube
Miguel
Updated on September 18, 2022Comments
-
Miguel over 1 year
I'm trying to make a simple subset of a df based on a POSIXct variable, but it doesn't work...
a2001 <- subset(anillas, anillas$data=="21-03-2001")
it gives "0 obs. of 74 variables"
are those variables different in any way I don't know?
Tks.
Ok, so this is part of the
str(anillas)
$ rc : num NA NA NA NA NA NA NA NA NA NA ... $ ss : num NA NA NA NA NA NA NA NA NA NA ... $ tg : num NA NA NA NA NA NA NA NA NA NA ... $ ug : num NA NA NA NA NA NA NA NA NA NA ... $ data : POSIXct, format: "2001-03-21" "2001-03-23" ...
-
GSee over 11 yearsplease add the output of
dput(head(anillas))
to your question. Also, please see stackoverflow.com/questions/5963269/… -
Miguel over 11 yearsdput showed a very very long list so it will take me a little while to prepare a short one (based on what you suggest)(i'm just begining with R)
-
ricardo over 11 yearsis the problem that your date format in
subset(annillas, anillas$data == "21-03-2001")
is different to the date format inanillas$data
? trywhich (anillas$data=="21-03-2001")
to see if anything is returned. If not, try again withwhich(anillas$data=="2001-03-21")
. I suspect thata2001 <- subset(anillas, anillas$data=="2001-03-21")
might do what you want. -
Miguel over 11 yearsin both cases I get
integer(0)
, with the original UK date format and with the US format
-
-
Joshua Ulrich over 11 yearsThere's nothing wrong with their data and what they show isn't impossible. If the time is exactly midnight, no time is printed by default. For example:
str(as.POSIXct("2012-11-21",tz="GMT"))
. -
plannapus over 11 years@JoshuaUlrich fair enough, I didn't know that (never encountered the case before to be honest, and thought it would print
00:00:00
). I tried to reproduce it but in my haste didn't specifytz="GMT"
, hence the01:00:00
. -
Miguel over 11 yearsI created date1 and then subset... but a2001 still
0 obs of 74 variables
-
Miguel over 11 yearsOk, finally I give up, I created a new variable with
year()
of packagelubridate
and everything worked fine. Thanks you all!! -
pramav almost 10 yearsHi, I've created new partition /dev/sda3. But when used resize2fs command, it showing error "resize2fs: Bad magic number in super-block while trying to open /dev/sda3 Couldn't find valid filesystem superblock."
-
pramav almost 10 yearsPlease let me know whats going wrong here?
-
mr_tron almost 10 yearsYou have created new partition /dev/sda3 without filesystems. But i don`t understand why. You had to create partition with same number that deleted and same offset for first block but large.
-
mr_tron almost 10 yearsReed your update. Just
mkfs.ext4 /dev/sda3
-
pramav almost 10 yearsI'm new to Linux and dont know these partition and physical volume concepts. I just want increase size /dev/sda2.
-
pramav almost 10 yearsYou mean to say i've to delete the existing /dev/sda2 and create new one with same name? data in /dev/sda2 will be lost right?
-
mr_tron almost 10 yearsI have writed simple list of commands. Just do them. (after you update: add
d 3
afterd 2
) -
mr_tron almost 10 yearsif you recreate partition with same number and offset (thirst block) no data will be loss. But be carefull.
-
mr_tron almost 10 yearsLet us continue this discussion in chat.
-
Henry F almost 7 yearsYou saved me a ton of time, thank you. By the way, this works for Arch Linux for any Arch users wondering.
-
Timo almost 3 yearsI have parted version 3.3, does it work? I want to increase
/dev/sda2
which is myswap
. -
Timo almost 3 yearsI have
/dev/sda1 2048 106745855 106743808 50.9G 83 Linux
and/dev/sda2 106745856 117229567 10483712 5G 82 Linux swap / Solaris
. Can I do your commands:parted /dev/sda
,resizepart
,resize2fs /dev/sda2
. Withdf
I do not see/dev/sda2
, just/dev/sda1
.Use in % is 36%, so much space on sda1 -
psusi over 2 years@Timo, if it is sda1 you want to resize, then that is what you will need to resize, not sda2. Also you don't have any free space to expand sda1 into.