You are not logged in.
# fdisk -l
Disk /dev/vda: 95 GiB, 102005473280 bytes, 199229440 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: 0xb26758c8
Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 197134335 197132288 94G 83 Linux
/dev/vda2 197134336 199229439 2095104 1023M 82 Linux swap / Solaris
Disk /dev/loop0: 10 GiB, 10737418240 bytes, 20971520 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
# df -h
Filesystem Size Used Avail Use% Mounted on
dev 983M 0 983M 0% /dev
run 991M 568K 990M 1% /run
/dev/vda1 93G 26G 62G 30% /
tmpfs 991M 0 991M 0% /dev/shm
tmpfs 199M 4.0K 199M 1% /run/user/0
tmpfs 199M 4.0K 199M 1% /run/user/1000
/dev/loop0 9.8G 148K 9.3G 1% /tmpI want to merge /dev/loop0 into the /dev/vda1, but I can only delete the content of /dev/loop0, what should I do
Last edited by malacology (2022-01-01 22:50:37)
Don't speak to silly man. Keep Minimalism.
Offline
Ah ... what?? You can "merge" partitions on a single device (really just delete one and expand the other) but you can't merge devices. This looks like an X-Y question: what are you really trying to do? You can have partitions on separate devices that can be mounted together with unionfs or similar approaches ... this *might* relate to your actual goals.
Last edited by Trilby (2022-01-01 18:32:11)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
okay
I try to delte
# fdisk /dev/loop0
Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
The device contains 'ext3' signature and it will be removed by a write command. See fdisk(8) man page and --wipe option for more details.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xea35b6f7.
Command (m for help): d
No partition is defined yet!
Command (m for help): p
Disk /dev/loop0: 10 GiB, 10737418240 bytes, 20971520 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: 0xea35b6f7
Command (m for help): d :
No partition is defined yet!Last edited by malacology (2022-01-01 18:45:03)
Don't speak to silly man. Keep Minimalism.
Offline
So you read neither my post, nor the output from fdisk ... I'm not sure what else to put here if you aren't going to read anything. Perhaps I could go find some pictures of cats.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
okay, I won't get any help on bbs now. Bye
Don't speak to silly man. Keep Minimalism.
Offline

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
dd if=/temp-dsik > /dev/zerothe reason is that my command to create the /dev/loop0
dd if=/dev/zero of=/temp-disk bs=2M count=5120
mke2fs -j /temp-disk
umount /tmp
vim /etc/fstabadd
/temp-disk /tmp ext4 rw,noexec,nosuid,loop 0 0mount -t ext4 -o rw,noexec,nosuid,loop /temp-disk /tmp
chmod 1777 /tmpLast edited by malacology (2022-01-01 20:15:47)
Don't speak to silly man. Keep Minimalism.
Offline
I want to merge /dev/loop0 into the /dev/vda2
/dev/vda2 197134336 199229439 2095104 1023M 82 Linux swap / Solaris
/dev/vda2 is a swap partition, 1GB. You want to put the contents of /dev/loop0 into the swap partition? Or you want to replace the swap partition with the contents of /dev/vda2? /dev/loop0 is 9.8GB.
/dev/loop0 is read only isn't it? You could make an .iso out of /dev/vda2 if you have space to store it. Depends on what loop0 is. Virtual machine?
dd if=/dev/vda2 of=myfile.iso bs=2048You can then write that to somewhere.
dd if=/temp-dsik > /dev/zero
Do you have a directory under / named temp-dsik? Or do you mean /home/<user>/temp-dsik? That redirects the contents to /dev/zero.
dd if=/dev/zero of=/temp-disk bs=2M count=5120
That writes zeros to the first 10240000000 of /temp-disk, if that actually exists.
If you are wanting to replace /dev/vda2, you can. You could delete it, or put an ext3/4 file system in it. Since it is a swap partition, you probably want to remove the reference in fstab to it. But it is only 1GB.
Offline
so sorry, I write mistakenly, sda1, I have /temp-disk
Don't speak to silly man. Keep Minimalism.
Offline