Skip to content

Instantly share code, notes, and snippets.

@noromanba
Last active December 12, 2015 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noromanba/4702723 to your computer and use it in GitHub Desktop.
Save noromanba/4702723 to your computer and use it in GitHub Desktop.
# at the 1st, fix TZ and time
$ sudo dpkg-reconfigure tzdata # -> to Asia/Tokyo UTC+9 from UTC
$ sudo aptitude update
$ sudo aptitude install ntpdate
$ sudo ntpdate ntp.nict.jp
# how to resize knoppix-data.img
# c.f. http://knoppix.net/forum/threads/28316-resizing-knoppix-data.img?p=120365
# backup persistent image
$ cp -v knoppix-data.img /media/sdc5/_backup/
#`knoppix-data.img' -> `/media/sdc5/_backup/knoppix-data.img'
# check filesystem
$ sudo e2fsck -fy knoppix-data.img
#e2fsck 1.42.4 (12-Jun-2012)
#Pass 1: Checking inodes, blocks, and sizes
#Deleted inode 17 has zero dtime. Fix? yes
#...
#Pass 2: Checking directory structure
#Pass 3: Checking directory connectivity
#Pass 3A: Optimizing directories
#Pass 4: Checking reference counts
#Pass 5: Checking group summary information
#Block bitmap differences:
#...
#knoppix-data.img: ***** FILE SYSTEM WAS MODIFIED *****
#knoppix-data.img: 17943/127488 files (5.2% non-contiguous), 392725/509440 blocks
# 1G extend to img by zerofill
$ sudo dd if=/dev/zero bs=1M count=1000 >> knoppix-data.img
#1000+0 records in
#1000+0 records out
#1048576000 bytes (1.0 GB) copied, 69.947 s, 15.0 MB/s
$ ll -h | grep knoppix-data.img
#...
#-rwxrwxrwx 1 knoppix knoppix 3.0G Feb 4 01:41 knoppix-data.img
#...
# resize filesystem
$ sudo resize2fs knoppix-data.img
#resize2fs 1.42.4 (12-Jun-2012)
#Resizing the filesystem on knoppix-data.img to 765440 (4k) blocks.
#The filesystem on knoppix-data.img is now 765440 blocks long.
$ mount -l | column -t
rootfs on / type rootfs (rw,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/sdb1 on /mnt-system type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp850,iocharset=iso8859-1,shortname=winnt,errors=remount-ro) [KNOPPIX]
tmpfs on /ramdisk type tmpfs (rw,relatime,size=2486272k)
/dev/cloop on /KNOPPIX type iso9660 (ro,relatime) [KNOPPIX]
/dev/loop0 on /KNOPPIX-DATA type ext2 (rw,relatime,errors=continue,user_xattr,acl)
unionfs on /UNIONFS type aufs (rw,relatime,si=2790346c,noplink)
unionfs on /usr type aufs (rw,relatime,si=2790346c,noplink)
unionfs on /home type aufs (rw,relatime,si=2790346c,noplink)
usbfs on /proc/bus/usb type usbfs (rw,relatime)
tmpfs on /UNIONFS/var/run type tmpfs (rw,relatime,size=10240k)
tmpfs on /run type tmpfs (rw,relatime,size=20480k)
tmpfs on /UNIONFS/var/lock type tmpfs (rw,relatime,size=10240k)
tmpfs on /UNIONFS/var/log type tmpfs (rw,relatime,size=102400k)
tmpfs on /tmp type tmpfs (rw,relatime,size=2097152k)
udev on /dev type tmpfs (rw,relatime,size=20480k)
tmpfs on /dev/shm type tmpfs (rw,relatime,size=2097152k)
devpts on /dev/pts type devpts (rw,relatime,mode=1777)
/dev/sdb2 on /media/sdb2 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp932,iocharset=utf8,shortname=winnt,errors=remount-ro) [DATA]
gvfs-fuse-daemon on /home/knoppix/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 3.6G 3.6G 9.1M 100% /mnt-system
tmpfs 2.4G 0 2.4G 0% /ramdisk
/dev/cloop 1.7G 1.7G 0 100% /KNOPPIX
/dev/loop0 2.9G 1.5G 1.5G 52% /KNOPPIX-DATA
unionfs 2.9G 1.5G 1.5G 52% /UNIONFS
unionfs 2.9G 1.5G 1.5G 52% /usr
unionfs 2.9G 1.5G 1.5G 52% /home
tmpfs 10M 216K 9.8M 3% /UNIONFS/var/run
tmpfs 20M 2.8M 18M 14% /run
tmpfs 10M 0 10M 0% /UNIONFS/var/lock
tmpfs 100M 144K 100M 1% /UNIONFS/var/log
tmpfs 2.0G 32K 2.0G 1% /tmp
udev 20M 4.0K 20M 1% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
/dev/sdb2 3.9G 952K 3.9G 1% /media/sdb2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment